has permission cosnumer skip logic

This commit is contained in:
Eugenio Romano
2019-02-13 15:01:26 +00:00
parent 801d9bfff8
commit 469bb214b5
5 changed files with 23 additions and 4 deletions

View File

@@ -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', () => {