revert change for AOS related to lock owners

This commit is contained in:
Denys Vuika
2019-03-06 15:58:50 +00:00
parent 003cadfd86
commit 22a256f09b
2 changed files with 8 additions and 4 deletions

View File

@@ -165,7 +165,7 @@ describe('evaluators', () => {
expect(canOpenWithOffice(context)).toBeFalsy();
});
it('should return [true] if current user is lock owner', () => {
it('should return [false] if current user is lock owner', () => {
const context: any = {
profile: {
id: 'user1'
@@ -186,7 +186,7 @@ describe('evaluators', () => {
}
};
expect(canOpenWithOffice(context)).toBeTruthy();
expect(canOpenWithOffice(context)).toBeFalsy();
});
it('should return [true] if all checks succeed', () => {

View File

@@ -47,8 +47,12 @@ export function canOpenWithOffice(
file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'
) {
const lockOwner = file.entry.properties['cm:lockOwner'];
return lockOwner && lockOwner.id === context.profile.id;
return false;
}
const lockOwner = file.entry.properties['cm:lockOwner'];
if (lockOwner && lockOwner.id !== context.profile.id) {
return false;
}
return true;