mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
has permission cosnumer skip logic
This commit is contained in:
@@ -167,6 +167,16 @@ describe('ContentService', () => {
|
||||
let permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } });
|
||||
expect(contentService.hasPermissions(permissionNode, null)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should havePermission return true if the permissions is empty and the permission to check is Consumer', () => {
|
||||
let permissionNode = new Node({ permissions: [] });
|
||||
expect(contentService.hasPermissions(permissionNode, 'Consumer')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should havePermission return false if the permissions is empty and the permission to check is not Consumer', () => {
|
||||
let permissionNode = new Node({ permissions: [] });
|
||||
expect(contentService.hasPermissions(permissionNode, '!Consumer')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Download blob', () => {
|
||||
|
||||
@@ -189,7 +189,12 @@ export class ContentService {
|
||||
}
|
||||
|
||||
} else {
|
||||
if (permission && permission.startsWith('!')) {
|
||||
|
||||
if (permission === PermissionsEnum.CONSUMER) {
|
||||
hasPermissions = true;
|
||||
} else if (permission === PermissionsEnum.NOT_CONSUMER) {
|
||||
hasPermissions = false
|
||||
} else if (permission && permission.startsWith('!')) {
|
||||
hasPermissions = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user