mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-24689] the add user or group icon is displayed within the folder permissions for a user with the collaborator role (#10373)
* [MNT-24689] Hide disallowed options for permissions * [MNT-24689] Used ng-container to wrap hidden buttons * MNT-24689 Unit tests * MNT-24689 Fixed sonar duplicated lines * [MNT-24689] Fixed sonar duplicated lines * [MNT-24689] Addressed comment
This commit is contained in:
@@ -15,15 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const fakeNodeWithPermissions: any = {
|
import { Node } from '@alfresco/js-api';
|
||||||
aspectNames: [
|
|
||||||
'cm:auditable',
|
const fakeBaseNode = {
|
||||||
'cm:taggable',
|
aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'],
|
||||||
'cm:author',
|
createdAt: new Date('2017-11-16T16:29:38.638+0000'),
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
path: {
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
name: '/Company Home/Sites/testsite/documentLibrary',
|
||||||
isComplete: true,
|
isComplete: true,
|
||||||
@@ -52,7 +48,11 @@ export const fakeNodeWithPermissions: any = {
|
|||||||
id: 'System',
|
id: 'System',
|
||||||
displayName: 'System'
|
displayName: 'System'
|
||||||
},
|
},
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
modifiedAt: new Date('2018-03-21T03:17:58.783+0000')
|
||||||
|
} as Node;
|
||||||
|
|
||||||
|
export const fakeNodeWithPermissions: any = {
|
||||||
|
...fakeBaseNode,
|
||||||
permissions: {
|
permissions: {
|
||||||
inherited: [
|
inherited: [
|
||||||
{
|
{
|
||||||
@@ -73,13 +73,7 @@ export const fakeNodeWithPermissions: any = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: true
|
isInheritanceEnabled: true
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -92,9 +86,7 @@ export const fakeNodeWithPermissions: any = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
@@ -102,14 +94,7 @@ export const fakeNodeWithPermissions: any = {
|
|||||||
|
|
||||||
export const fakeNodeInheritedOnly = {
|
export const fakeNodeInheritedOnly = {
|
||||||
allowableOperations: ['updatePermissions'],
|
allowableOperations: ['updatePermissions'],
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
path: {
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
name: '/Company Home/Sites/testsite/documentLibrary',
|
||||||
isComplete: true,
|
isComplete: true,
|
||||||
@@ -133,13 +118,6 @@ export const fakeNodeInheritedOnly = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
inherited: [
|
inherited: [
|
||||||
{
|
{
|
||||||
@@ -153,13 +131,7 @@ export const fakeNodeInheritedOnly = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: true
|
isInheritanceEnabled: true
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -172,52 +144,14 @@ export const fakeNodeInheritedOnly = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fakeReadOnlyNodeInherited = {
|
export const fakeReadOnlyNodeInherited = {
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
|
||||||
isComplete: true,
|
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
id: '2be275a1-b00d-4e45-83d8-66af43ac2252',
|
|
||||||
name: 'Company Home'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
|
||||||
name: 'Sites'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0',
|
|
||||||
name: 'testsite'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '71626fae-0c04-4d0c-a129-20fa4c178716',
|
|
||||||
name: 'documentLibrary'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
inherited: [
|
inherited: [
|
||||||
{
|
{
|
||||||
@@ -231,13 +165,7 @@ export const fakeReadOnlyNodeInherited = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: true
|
isInheritanceEnabled: true
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -250,56 +178,14 @@ export const fakeReadOnlyNodeInherited = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fakeNodeWithoutSite: any = {
|
export const fakeNodeWithoutSite: any = {
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
|
||||||
name: '/Company Home/User Homes/user/documentLibrary',
|
|
||||||
isComplete: true,
|
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
id: '2be275a1-b00d-4e45-83d8-66af43ac2252',
|
|
||||||
name: 'Company Home',
|
|
||||||
nodeType: 'cm:folder'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
|
||||||
name: 'User Homes',
|
|
||||||
nodeType: 'cm:folder'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0',
|
|
||||||
name: 'user',
|
|
||||||
nodeType: 'cm:folder'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '71626fae-0c04-4d0c-a129-20fa4c178716',
|
|
||||||
name: 'documentLibrary',
|
|
||||||
nodeType: 'cm:folder'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
locallySet: [
|
locallySet: [
|
||||||
{
|
{
|
||||||
@@ -308,13 +194,7 @@ export const fakeNodeWithoutSite: any = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: false
|
isInheritanceEnabled: false
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -327,23 +207,15 @@ export const fakeNodeWithoutSite: any = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fakeNodeWithOnlyLocally: any = {
|
export const fakeNodeWithOnlyLocally: any = {
|
||||||
aspectNames: [
|
allowableOperations: ['updatePermissions'],
|
||||||
'cm:auditable',
|
...fakeBaseNode,
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
path: {
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
name: '/Company Home/Sites/testsite/documentLibrary',
|
||||||
isComplete: true,
|
isComplete: true,
|
||||||
@@ -370,13 +242,6 @@ export const fakeNodeWithOnlyLocally: any = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
locallySet: [
|
locallySet: [
|
||||||
{
|
{
|
||||||
@@ -385,13 +250,7 @@ export const fakeNodeWithOnlyLocally: any = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: false
|
isInheritanceEnabled: false
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -404,52 +263,14 @@ export const fakeNodeWithOnlyLocally: any = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fakeNodeToRemovePermission: any = {
|
export const fakeNodeToRemovePermission: any = {
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
|
||||||
isComplete: true,
|
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
id: '2be275a1-b00d-4e45-83d8-66af43ac2252',
|
|
||||||
name: 'Company Home'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
|
||||||
name: 'Sites'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0',
|
|
||||||
name: 'testsite'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '71626fae-0c04-4d0c-a129-20fa4c178716',
|
|
||||||
name: 'documentLibrary'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
locallySet: [
|
locallySet: [
|
||||||
{
|
{
|
||||||
@@ -468,13 +289,7 @@ export const fakeNodeToRemovePermission: any = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: true
|
isInheritanceEnabled: true
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -487,52 +302,14 @@ export const fakeNodeToRemovePermission: any = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fakeNodeWithoutPermissions: any = {
|
export const fakeNodeWithoutPermissions: any = {
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
|
||||||
isComplete: true,
|
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
id: '2be275a1-b00d-4e45-83d8-66af43ac2252',
|
|
||||||
name: 'Company Home'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
|
||||||
name: 'Sites'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0',
|
|
||||||
name: 'testsite'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '71626fae-0c04-4d0c-a129-20fa4c178716',
|
|
||||||
name: 'documentLibrary'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
locallySet: [],
|
locallySet: [],
|
||||||
settable: [],
|
settable: [],
|
||||||
@@ -548,9 +325,7 @@ export const fakeNodeWithoutPermissions: any = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
@@ -578,11 +353,7 @@ export const fakeSiteNodeResponse: any = {
|
|||||||
modifiedAt: '2018-03-22T15:40:10.093+0000',
|
modifiedAt: '2018-03-22T15:40:10.093+0000',
|
||||||
nodeType: 'st:site',
|
nodeType: 'st:site',
|
||||||
parentId: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
parentId: '1be10a97-6eb9-4b60-b6c6-1673900e9631',
|
||||||
aspectNames: [
|
aspectNames: ['cm:tagscope', 'cm:titled', 'cm:auditable'],
|
||||||
'cm:tagscope',
|
|
||||||
'cm:titled',
|
|
||||||
'cm:auditable'
|
|
||||||
],
|
|
||||||
createdAt: '2018-03-22T15:39:50.821+0000',
|
createdAt: '2018-03-22T15:39:50.821+0000',
|
||||||
isFolder: true,
|
isFolder: true,
|
||||||
search: {
|
search: {
|
||||||
@@ -664,14 +435,7 @@ export const fakeEmptyResponse: any = {
|
|||||||
|
|
||||||
export const fakeNodeLocalSiteManager = {
|
export const fakeNodeLocalSiteManager = {
|
||||||
allowableOperations: ['updatePermissions'],
|
allowableOperations: ['updatePermissions'],
|
||||||
aspectNames: [
|
...fakeBaseNode,
|
||||||
'cm:auditable',
|
|
||||||
'cm:taggable',
|
|
||||||
'cm:author',
|
|
||||||
'cm:titled',
|
|
||||||
'app:uifacets'
|
|
||||||
],
|
|
||||||
createdAt: '2017-11-16T16:29:38.638+0000',
|
|
||||||
path: {
|
path: {
|
||||||
name: '/Company Home/Sites/testsite/documentLibrary',
|
name: '/Company Home/Sites/testsite/documentLibrary',
|
||||||
isComplete: true,
|
isComplete: true,
|
||||||
@@ -695,13 +459,6 @@ export const fakeNodeLocalSiteManager = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
isFolder: true,
|
|
||||||
isFile: false,
|
|
||||||
createdByUser: {
|
|
||||||
id: 'System',
|
|
||||||
displayName: 'System'
|
|
||||||
},
|
|
||||||
modifiedAt: '2018-03-21T03:17:58.783+0000',
|
|
||||||
permissions: {
|
permissions: {
|
||||||
locallySet: [
|
locallySet: [
|
||||||
{
|
{
|
||||||
@@ -715,13 +472,7 @@ export const fakeNodeLocalSiteManager = {
|
|||||||
accessStatus: 'ALLOWED'
|
accessStatus: 'ALLOWED'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settable: [
|
settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'],
|
||||||
'Contributor',
|
|
||||||
'Collaborator',
|
|
||||||
'Coordinator',
|
|
||||||
'Editor',
|
|
||||||
'Consumer'
|
|
||||||
],
|
|
||||||
isInheritanceEnabled: false
|
isInheritanceEnabled: false
|
||||||
},
|
},
|
||||||
modifiedByUser: {
|
modifiedByUser: {
|
||||||
@@ -734,9 +485,7 @@ export const fakeNodeLocalSiteManager = {
|
|||||||
properties: {
|
properties: {
|
||||||
'cm:title': 'test',
|
'cm:title': 'test',
|
||||||
'cm:author': 'yagud',
|
'cm:author': 'yagud',
|
||||||
'cm:taggable': [
|
'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'],
|
||||||
'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'
|
|
||||||
],
|
|
||||||
'cm:description': 'sleepery',
|
'cm:description': 'sleepery',
|
||||||
'app:icon': 'space-icon-default'
|
'app:icon': 'space-icon-default'
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<mat-slide-toggle
|
<mat-slide-toggle
|
||||||
|
*ngIf="updatePermissionsAllowed"
|
||||||
class="adf-inherit-toggle"
|
class="adf-inherit-toggle"
|
||||||
title="{{'PERMISSION_MANAGER.LABELS.INHERITED_PERMISSION_TOGGLE' | translate }}"
|
title="{{'PERMISSION_MANAGER.LABELS.INHERITED_PERMISSION_TOGGLE' | translate }}"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
|
|
||||||
<div class="adf-toolbar--spacer"></div>
|
<div class="adf-toolbar--spacer"></div>
|
||||||
|
|
||||||
|
<ng-container *ngIf="updatePermissionsAllowed">
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
title="{{'PERMISSION_MANAGER.ACTION.ADD-PERMISSION' | translate}}"
|
title="{{'PERMISSION_MANAGER.ACTION.ADD-PERMISSION' | translate}}"
|
||||||
@@ -84,8 +86,9 @@
|
|||||||
[disabled]="!selectedPermissions?.length"
|
[disabled]="!selectedPermissions?.length"
|
||||||
(click)="deleteSelection()"
|
(click)="deleteSelection()"
|
||||||
data-automation-id="adf-delete-selected-permission">
|
data-automation-id="adf-delete-selected-permission">
|
||||||
<mat-icon class="adf-delete-selected-permission-icon">delete_outline</mat-icon>
|
<mat-icon>delete_outline</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
</ng-container>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<adf-permission-container
|
<adf-permission-container
|
||||||
@@ -98,7 +101,8 @@
|
|||||||
(updateAll)="updateAllPermission($event)"
|
(updateAll)="updateAllPermission($event)"
|
||||||
(row-select)="onSelect($any($event).detail.selection)"
|
(row-select)="onSelect($any($event).detail.selection)"
|
||||||
(row-unselect)="onSelect($any($event).detail.selection)"
|
(row-unselect)="onSelect($any($event).detail.selection)"
|
||||||
[roles]="model.roles" />
|
[roles]="model.roles"
|
||||||
|
[isReadOnly]="!updatePermissionsAllowed"/>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@@ -89,10 +89,6 @@
|
|||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-delete-selected-permission-icon {
|
|
||||||
color: var(--theme-grey-divider-color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[aria-sort='Ascending'] adf-user-role-column,
|
[aria-sort='Ascending'] adf-user-role-column,
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, Subject, throwError } from 'rxjs';
|
||||||
import { SearchService } from '../../../search/services/search.service';
|
import { SearchService } from '../../../search/services/search.service';
|
||||||
import { PermissionListComponent } from './permission-list.component';
|
import { PermissionListComponent } from './permission-list.component';
|
||||||
import { NodePermissionService } from '../../services/node-permission.service';
|
import { NodePermissionService } from '../../services/node-permission.service';
|
||||||
@@ -38,6 +38,11 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
|||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
|
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
|
||||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||||
|
import { By } from '@angular/platform-browser';
|
||||||
|
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||||
|
import { ContentService } from '../../../common/services/content.service';
|
||||||
|
import { AllowableOperationsEnum, NodePermissionsModel, PermissionContainerComponent } from '@alfresco/adf-content-services';
|
||||||
|
import { DebugElement } from '@angular/core';
|
||||||
|
|
||||||
describe('PermissionListComponent', () => {
|
describe('PermissionListComponent', () => {
|
||||||
let loader: HarnessLoader;
|
let loader: HarnessLoader;
|
||||||
@@ -47,8 +52,10 @@ describe('PermissionListComponent', () => {
|
|||||||
let nodeService: NodesApiService;
|
let nodeService: NodesApiService;
|
||||||
let nodePermissionService: NodePermissionService;
|
let nodePermissionService: NodePermissionService;
|
||||||
let searchApiService: SearchService;
|
let searchApiService: SearchService;
|
||||||
|
let contentService: ContentService;
|
||||||
let getNodeSpy: jasmine.Spy;
|
let getNodeSpy: jasmine.Spy;
|
||||||
let searchQuerySpy: jasmine.Spy;
|
let searchQuerySpy: jasmine.Spy;
|
||||||
|
|
||||||
const fakeLocalPermission = JSON.parse(JSON.stringify(fakeNodeWithOnlyLocally));
|
const fakeLocalPermission = JSON.parse(JSON.stringify(fakeNodeWithOnlyLocally));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -61,6 +68,7 @@ describe('PermissionListComponent', () => {
|
|||||||
nodeService = TestBed.inject(NodesApiService);
|
nodeService = TestBed.inject(NodesApiService);
|
||||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||||
searchApiService = TestBed.inject(SearchService);
|
searchApiService = TestBed.inject(SearchService);
|
||||||
|
contentService = TestBed.inject(ContentService);
|
||||||
|
|
||||||
spyOn(nodePermissionService, 'getGroupMemberByGroupName').and.returnValue(of(fakeSiteRoles));
|
spyOn(nodePermissionService, 'getGroupMemberByGroupName').and.returnValue(of(fakeSiteRoles));
|
||||||
getNodeSpy = spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeWithoutPermissions));
|
getNodeSpy = spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeWithoutPermissions));
|
||||||
@@ -132,6 +140,7 @@ describe('PermissionListComponent', () => {
|
|||||||
|
|
||||||
it('should toggle the inherited button', async () => {
|
it('should toggle the inherited button', async () => {
|
||||||
getNodeSpy.and.returnValue(of(fakeNodeInheritedOnly));
|
getNodeSpy.and.returnValue(of(fakeNodeInheritedOnly));
|
||||||
|
spyOn(contentService, 'hasAllowableOperations').and.returnValue(true);
|
||||||
component.ngOnInit();
|
component.ngOnInit();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@@ -142,6 +151,7 @@ describe('PermissionListComponent', () => {
|
|||||||
'PERMISSION_MANAGER.LABELS.INHERITED-PERMISSIONS PERMISSION_MANAGER.LABELS.ON'
|
'PERMISSION_MANAGER.LABELS.INHERITED-PERMISSIONS PERMISSION_MANAGER.LABELS.ON'
|
||||||
);
|
);
|
||||||
expect(element.querySelector('span[title="total"]').textContent.trim()).toBe('PERMISSION_MANAGER.LABELS.INHERITED-SUBTITLE');
|
expect(element.querySelector('span[title="total"]').textContent.trim()).toBe('PERMISSION_MANAGER.LABELS.INHERITED-SUBTITLE');
|
||||||
|
expect(contentService.hasAllowableOperations).toHaveBeenCalledWith(fakeNodeInheritedOnly, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
|
||||||
spyOn(nodeService, 'updateNode').and.returnValue(of(fakeLocalPermission));
|
spyOn(nodeService, 'updateNode').and.returnValue(of(fakeLocalPermission));
|
||||||
|
|
||||||
@@ -155,28 +165,18 @@ describe('PermissionListComponent', () => {
|
|||||||
|
|
||||||
it('should not toggle inherited button for read only users', async () => {
|
it('should not toggle inherited button for read only users', async () => {
|
||||||
getNodeSpy.and.returnValue(of(fakeReadOnlyNodeInherited));
|
getNodeSpy.and.returnValue(of(fakeReadOnlyNodeInherited));
|
||||||
|
spyOn(contentService, 'hasAllowableOperations').and.returnValue(false);
|
||||||
component.ngOnInit();
|
component.ngOnInit();
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
|
|
||||||
const toggle = await loader.getHarness(MatSlideToggleHarness);
|
expect(fixture.debugElement.query(By.directive(MatSlideToggle))).toBeNull();
|
||||||
expect(await toggle.isChecked()).toBe(true);
|
|
||||||
|
|
||||||
expect(element.querySelector('.adf-inherit-container h3').textContent.trim()).toBe(
|
expect(element.querySelector('.adf-inherit-container h3').textContent.trim()).toBe(
|
||||||
'PERMISSION_MANAGER.LABELS.INHERITED-PERMISSIONS PERMISSION_MANAGER.LABELS.ON'
|
'PERMISSION_MANAGER.LABELS.INHERITED-PERMISSIONS PERMISSION_MANAGER.LABELS.ON'
|
||||||
);
|
);
|
||||||
expect(element.querySelector('span[title="total"]').textContent.trim()).toBe('PERMISSION_MANAGER.LABELS.INHERITED-SUBTITLE');
|
expect(element.querySelector('span[title="total"]').textContent.trim()).toBe('PERMISSION_MANAGER.LABELS.INHERITED-SUBTITLE');
|
||||||
|
expect(contentService.hasAllowableOperations).toHaveBeenCalledWith(fakeReadOnlyNodeInherited, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
spyOn(nodeService, 'updateNode').and.returnValue(of(fakeLocalPermission));
|
|
||||||
|
|
||||||
await toggle.uncheck();
|
|
||||||
|
|
||||||
expect(element.querySelector('.adf-inherit-container h3').textContent.trim()).toBe(
|
|
||||||
'PERMISSION_MANAGER.LABELS.INHERITED-PERMISSIONS PERMISSION_MANAGER.LABELS.ON'
|
|
||||||
);
|
|
||||||
expect(element.querySelector('span[title="total"]').textContent.trim()).toBe('PERMISSION_MANAGER.LABELS.INHERITED-SUBTITLE');
|
|
||||||
expect(document.querySelector('.adf-snackbar-message-content').textContent).toContain('PERMISSION_MANAGER.ERROR.NOT-ALLOWED');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -275,4 +275,116 @@ describe('PermissionListComponent', () => {
|
|||||||
expect(nodeService.updateNode).toHaveBeenCalledWith('f472543f-7218-403d-917b-7a5861257244', { permissions: { locallySet: [] } });
|
expect(nodeService.updateNode).toHaveBeenCalledWith('f472543f-7218-403d-917b-7a5861257244', { permissions: { locallySet: [] } });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Permission container', () => {
|
||||||
|
let data$: Subject<NodePermissionsModel>;
|
||||||
|
let hasAllowableOperationsSpy: jasmine.Spy<(node: Node, allowableOperation: AllowableOperationsEnum | string) => boolean>;
|
||||||
|
|
||||||
|
const getPermissionContainerComponent = (): PermissionContainerComponent =>
|
||||||
|
fixture.debugElement.query(By.directive(PermissionContainerComponent)).componentInstance;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
data$ = new Subject<NodePermissionsModel>();
|
||||||
|
component.permissionList.data$ = data$;
|
||||||
|
hasAllowableOperationsSpy = spyOn(TestBed.inject(ContentService), 'hasAllowableOperations');
|
||||||
|
component.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have assigned isReadOnly to false if updating of permissions is allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(true);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getPermissionContainerComponent().isReadOnly).toBe(false);
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have assigned isReadOnly to true if updating of permissions is not allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(false);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithoutPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getPermissionContainerComponent().isReadOnly).toBe(true);
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithoutPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Toolbar actions', () => {
|
||||||
|
let data$: Subject<NodePermissionsModel>;
|
||||||
|
let hasAllowableOperationsSpy: jasmine.Spy<(node: Node, allowableOperation: AllowableOperationsEnum | string) => boolean>;
|
||||||
|
|
||||||
|
const getAddPermissionButton = (): DebugElement => fixture.debugElement.query(By.css('[data-automation-id="adf-add-permission-button"]'));
|
||||||
|
|
||||||
|
const getDeletePermissionButton = (): DebugElement =>
|
||||||
|
fixture.debugElement.query(By.css('[data-automation-id="adf-delete-selected-permission"]'));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
data$ = new Subject<NodePermissionsModel>();
|
||||||
|
component.permissionList.data$ = data$;
|
||||||
|
hasAllowableOperationsSpy = spyOn(TestBed.inject(ContentService), 'hasAllowableOperations');
|
||||||
|
component.ngOnInit();
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should display add permission button if updating of permissions is allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(true);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getAddPermissionButton()).not.toBeNull();
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not display add permission button if updating of permissions is not allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(false);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithoutPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getAddPermissionButton()).toBeNull();
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithoutPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should display delete permission button if updating of permissions is allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(true);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getDeletePermissionButton()).not.toBeNull();
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not display delete permission button if updating of permissions is not allowed', () => {
|
||||||
|
hasAllowableOperationsSpy.and.returnValue(false);
|
||||||
|
data$.next({
|
||||||
|
node: fakeNodeWithoutPermissions,
|
||||||
|
inheritedPermissions: [],
|
||||||
|
localPermissions: []
|
||||||
|
} as NodePermissionsModel);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(getDeletePermissionButton()).toBeNull();
|
||||||
|
expect(hasAllowableOperationsSpy).toHaveBeenCalledWith(fakeNodeWithoutPermissions, AllowableOperationsEnum.UPDATEPERMISSIONS);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ObjectDataRow } from '@alfresco/adf-core';
|
import { ObjectDataRow } from '@alfresco/adf-core';
|
||||||
import { PermissionElement } from '@alfresco/js-api';
|
import { PermissionElement } from '@alfresco/js-api';
|
||||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
import { Component, DestroyRef, EventEmitter, inject, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||||
import { PermissionDisplayModel } from '../../models/permission.model';
|
import { PermissionDisplayModel } from '../../models/permission.model';
|
||||||
import { PermissionListService } from './permission-list.service';
|
import { PermissionListService } from './permission-list.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
@@ -29,6 +29,8 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { PermissionContainerComponent } from '../permission-container/permission-container.component';
|
import { PermissionContainerComponent } from '../permission-container/permission-container.component';
|
||||||
import { PopOverDirective } from '../pop-over.directive';
|
import { PopOverDirective } from '../pop-over.directive';
|
||||||
|
import { AllowableOperationsEnum, ContentService } from '../../../common';
|
||||||
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-permission-list',
|
selector: 'adf-permission-list',
|
||||||
@@ -63,13 +65,30 @@ export class PermissionListComponent implements OnInit {
|
|||||||
|
|
||||||
selectedPermissions: PermissionDisplayModel[] = [];
|
selectedPermissions: PermissionDisplayModel[] = [];
|
||||||
|
|
||||||
constructor(public readonly permissionList: PermissionListService) {
|
private _updatePermissionsAllowed = false;
|
||||||
|
|
||||||
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
|
get updatePermissionsAllowed(): boolean {
|
||||||
|
return this._updatePermissionsAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(public readonly permissionList: PermissionListService, private readonly contentService: ContentService) {
|
||||||
this.error = this.permissionList.errored;
|
this.error = this.permissionList.errored;
|
||||||
this.update = this.permissionList.updated;
|
this.update = this.permissionList.updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.permissionList.fetchPermission(this.nodeId);
|
this.permissionList.fetchPermission(this.nodeId);
|
||||||
|
this.permissionList.data$
|
||||||
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||||
|
.subscribe(
|
||||||
|
(model) =>
|
||||||
|
(this._updatePermissionsAllowed = this.contentService.hasAllowableOperations(
|
||||||
|
model.node,
|
||||||
|
AllowableOperationsEnum.UPDATEPERMISSIONS
|
||||||
|
))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
openAddPermissionDialog() {
|
openAddPermissionDialog() {
|
||||||
|
Reference in New Issue
Block a user