mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
revert change for AOS related to lock owners
This commit is contained in:
@@ -165,7 +165,7 @@ describe('evaluators', () => {
|
|||||||
expect(canOpenWithOffice(context)).toBeFalsy();
|
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 = {
|
const context: any = {
|
||||||
profile: {
|
profile: {
|
||||||
id: 'user1'
|
id: 'user1'
|
||||||
@@ -186,7 +186,7 @@ describe('evaluators', () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(canOpenWithOffice(context)).toBeTruthy();
|
expect(canOpenWithOffice(context)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return [true] if all checks succeed', () => {
|
it('should return [true] if all checks succeed', () => {
|
||||||
|
@@ -47,8 +47,12 @@ export function canOpenWithOffice(
|
|||||||
file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
|
file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
|
||||||
file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'
|
file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'
|
||||||
) {
|
) {
|
||||||
const lockOwner = file.entry.properties['cm:lockOwner'];
|
return false;
|
||||||
return lockOwner && lockOwner.id === context.profile.id;
|
}
|
||||||
|
|
||||||
|
const lockOwner = file.entry.properties['cm:lockOwner'];
|
||||||
|
if (lockOwner && lockOwner.id !== context.profile.id) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user