mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-6278] - stop showing 'edit aspects' and 'manage rules' when node is a smart folder (#3512)
* [ACS-6278] - stop showing 'edit aspects' and 'manage rules' when node is a smart folder
This commit is contained in:
@@ -495,7 +495,8 @@ export const canEditAspects = (context: RuleContext): boolean =>
|
||||
canUpdateSelectedNode(context),
|
||||
!isWriteLocked(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
repository.isMajorVersionAvailable(context, '7')
|
||||
repository.isMajorVersionAvailable(context, '7'),
|
||||
!isSmartFolder(context)
|
||||
].every(Boolean);
|
||||
|
||||
/**
|
||||
@@ -505,7 +506,7 @@ export const canEditAspects = (context: RuleContext): boolean =>
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export const canManagePermissions = (context: RuleContext): boolean =>
|
||||
[canUpdateSelectedNode(context), navigation.isNotTrashcan(context)].every(Boolean);
|
||||
[canUpdateSelectedNode(context), navigation.isNotTrashcan(context), !isSmartFolder(context)].every(Boolean);
|
||||
|
||||
/**
|
||||
* Checks if user can toggle **Edit Offline** mode for selected node.
|
||||
@@ -624,3 +625,15 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {
|
||||
|
||||
return context.permissions.check(file, ['update']);
|
||||
}
|
||||
|
||||
function isSmartFolder(context: RuleContext): boolean {
|
||||
if (!context.selection?.isEmpty) {
|
||||
const node = context.selection.first;
|
||||
if (!node?.entry.isFolder) {
|
||||
return false;
|
||||
}
|
||||
const nodeAspects = node.entry?.aspectNames ?? [];
|
||||
return nodeAspects.includes('smf:customConfigSmartFolder') || nodeAspects.includes('smf:systemConfigSmartFolder');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user