Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-8694] Cleanup of visibility rules for extensions in ACA #4140

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6cb4749
[ACS-8694] Updated occurrences of visible in extensions.json to use a…
swapnil-verma-gl Sep 18, 2024
987232c
[ACS-8694] Removed extra commas
swapnil-verma-gl Sep 18, 2024
0f4b24b
[ACS-8694] Broke down canDelete rule into seperate entities
swapnil-verma-gl Sep 18, 2024
64a0c3a
[ACS-8694] Fixed typo for notEmpty rule
swapnil-verma-gl Sep 18, 2024
687e280
[ACS-8694] Fixed rule for edit offline
swapnil-verma-gl Sep 18, 2024
743afbd
[ACS-8694] Updated extension.schema.json
swapnil-verma-gl Sep 18, 2024
0b1e8f6
[ACS-8694] Updated extension.schema.json
swapnil-verma-gl Sep 18, 2024
f18dbb3
[ACS-8694] Fixed rule for manage versions context menu item
swapnil-verma-gl Sep 19, 2024
64cd59e
[ACS-8694] Fixed rule for manage versions and manage permissions
swapnil-verma-gl Sep 19, 2024
66b9d20
[ACS-8694] Added rules.canManageFolderRules
swapnil-verma-gl Sep 19, 2024
5a31c92
[ACS-8694] Fixed typo
swapnil-verma-gl Sep 19, 2024
fcc3c78
[ACS-8694] Updated visibility rules for folder rules and AOS plugin
swapnil-verma-gl Sep 19, 2024
ca12e22
[ACS-8694] Updated extension.schema.json
swapnil-verma-gl Sep 19, 2024
5a62619
[ACS-8694] Updated existing rules to use !isTrashcan() instead of isN…
swapnil-verma-gl Sep 20, 2024
f13c024
[ACS-8694] folder-rules.plugin.json now uses arrays for controlling v…
swapnil-verma-gl Sep 20, 2024
2c7571f
[ACS-8694] Updated app.extensions.schema
swapnil-verma-gl Sep 20, 2024
38d8c1f
[ACS-8694] Removed unused rules
swapnil-verma-gl Sep 20, 2024
7e9553b
[ACS-8694] Added unit tests for canToggleFileLock
swapnil-verma-gl Sep 20, 2024
11759d1
[ACS-8694] Added rules-list.md
swapnil-verma-gl Sep 20, 2024
0e6cd40
[ACS-8694] Revert unneeded project.json change
swapnil-verma-gl Sep 26, 2024
abaf014
[ACS-8694] Fixed toggleEditOffline rule
swapnil-verma-gl Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docs/extending/rules-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
Title: Rules List
---

# Rules List

The following is a comprehensive list of all rules/evaluators available in the Alfresco content application,
under different modules. You may use these existing rules, or create your own following the
[rules](./rules.md) guide when building your extensions.

### AOS Extension plugin

Rules related to the Alfresco Office Services plugin

| Ver. | Key | Description |
|-------|-----------------------|-------------------------------------------------|
| 2.9.0 | aos.canOpenWithOffice | Checks if the file can be opened with MS Office |

### Folder Rules plugin

Rules related to the folder rules plugin

| Ver. | Key | Description |
|-------|----------------------------|-----------------------------------------------------|
| 5.1.1 | rules.isFolderRulesEnabled | Checks if the folder rules plugin is enabled or not |

### Content Services plugin

#### Application Rules/Evaluators

Application related evaluators which can be used to check various different aspects of the users interaction with the application

| Ver. | Key | Description |
|--------|-------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 1.7.0 | app.selection.canDelete | User has permission to delete selected node(s). |
| 1.7.0 | app.selection.canDownload | User can download selected node(s). |
| 1.7.0 | app.selection.notEmpty | At least one node is selected. |
| 1.7.0 | app.selection.canAddFavorite | User can add selected node(s) to favorites. |
| 1.7.0 | app.selection.canRemoveFavorite | User can remove selected node(s) from favorites. |
| 1.7.0 | app.selection.first.canUpdate | User has permission to update selected node(s). |
| 1.7.0 | app.selection.file | A single File node is selected. |
| 1.7.0 | app.selection.file.isLocked | File is locked for editing. |
| 1.7.0 | app.selection.file.canUploadVersion | User can update file version. |
| 1.7.0 | app.selection.library | A single Library node is selected. |
| 1.7.0 | app.selection.hasLibraryRole | The selected Library node has a role property. |
| 1.7.0 | app.selection.folder | A single Folder node is selected. |
| 1.7.0 | app.selection.folder.canUpdate | User has permissions to update the selected folder. |
| 1.8.0 | canToggleJoinLibrary | Checks if user can perform "Join" or "Cancel Join Request" on a library. |
| 1.8.0 | canToggleSharedLink | Checks if user can toggle shared link mode. |
| 1.8.0 | canToggleFavorite | Checks whether the user can add/remove the selected file from favorites |
| 1.9.0 | app.canShowLogout | Whether logout action should be present or not. |
| 1.12.0 | isLibraryManager | Checks if user is library manager. |
| 2.3.0 | canEditAspects | Checks whether the user can change the aspects of the selected file |
| 2.10.0 | app.isContentServiceEnabled | Checks if the content services plugin is enabled or not |
| 4.4.0 | app.areTagsEnabled | Checks if the tags module is enabled or not |
| 4.4.0 | app.areCategoriesEnabled | Checks if the categories module is enabled or not |
| 5.1.1 | canToggleFileLock | Checks whether the user can lock/unlock the selected file |
| 5.1.1 | isSmartFolder | Checks if the selected folder has the 'smf:customConfigSmartFolder' or the 'smf:systemConfigSmartFolder' aspect or not |
| 5.1.1 | isMultiSelection | Checks if the user has selected multiple files |

#### Navigation Rules/Evaluators

Navigation related rules/evaluators which can be used to determine if the user is on a specific location within the application
or not.

| Version | Key | Description |
|---------|---------------------------------|------------------------------------------------------------------|
| 1.7.0 | app.navigation.folder.canCreate | User can create content in the currently opened folder. |
| 1.7.0 | app.navigation.isTrashcan | User is using the **Trashcan** page. |
| 1.7.0 | app.navigation.isLibraries | User is using a **Libraries** or **Library Search Result** page. |
| 1.7.0 | app.navigation.isSharedFiles | User is using the **Shared Files** page. |
| 1.7.0 | app.navigation.isFavorites | User is using the **Favorites** page. |
| 1.7.0 | app.navigation.isRecentFiles | User is using the **Recent Files** page. |
| 1.7.0 | app.navigation.isSearchResults | User is using the **Search Results** page. |
| 1.7.0 | app.navigation.isPreview | Current page is **Preview**. |
| 5.1.1 | app.navigation.isDetails | User is currently on the **Folder Details** page. |


32 changes: 0 additions & 32 deletions docs/extending/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,38 +134,18 @@ The button will be visible only when the linked rule evaluates to `true`.
| 1.7.0 | app.selection.canDelete | User has permission to delete selected node(s). |
| 1.7.0 | app.selection.canDownload | User can download selected node(s). |
| 1.7.0 | app.selection.notEmpty | At least one node is selected. |
| 1.7.0 | app.selection.canUnshare | User is able to remove selected node(s) from public sharing. |
| 1.7.0 | app.selection.canAddFavorite | User can add selected node(s) to favorites. |
| 1.7.0 | app.selection.canRemoveFavorite | User can remove selected node(s) from favorites. |
| 1.7.0 | app.selection.first.canUpdate | User has permission to update selected node(s). |
| 1.7.0 | app.selection.file | A single File node is selected. |
| 1.7.0 | app.selection.file.canShare | User is able to share the selected file. |
| 1.7.0 | app.selection.file.isShared | A shared node is selected. |
| 1.7.0 | app.selection.file.isLocked | File is locked for editing. |
| 1.7.0 | app.selection.file.isLockOwner | File is locked and current user is the lock owner. |
| 1.7.0 | app.selection.file.canUploadVersion | User can update file version. |
| 1.7.0 | app.selection.library | A single Library node is selected. |
| 1.7.0 | app.selection.isPrivateLibrary | A private Library node is selected. |
| 1.7.0 | app.selection.hasLibraryRole | The selected Library node has a role property. |
| 1.7.0 | app.selection.hasNoLibraryRole | The selected Library node has no role property. |
| 1.7.0 | app.selection.folder | A single Folder node is selected. |
| 1.7.0 | app.selection.folder.canUpdate | User has permissions to update the selected folder. |
| 1.7.0 | app.selection.folder.canUpdate | User has permissions to update the selected folder. |
| 1.7.0 | app.selection.file.canLock | User has permissions to lock file. |
| 1.7.0 | app.selection.file.canUnlock | User has permissions to unlock file. |
| 1.7.0 | repository.isQuickShareEnabled | Whether the quick share repository option is enabled or not. |
| 1.8.0 | canCopyNode | Checks if user can copy selected node. |
| 1.8.0 | canToggleJoinLibrary | Checks if user can perform "Join" or "Cancel Join Request" on a library. |
| 1.8.0 | canEditFolder | Checks if user can edit the selected folder. |
| 1.8.0 | isTrashcanItemSelected | Checks if user has trashcan item selected. |
| 1.8.0 | canViewFile | Checks if user can view the file. |
| 1.8.0 | canLeaveLibrary | Checks if user can **Leave** selected library. |
| 1.8.0 | canToggleSharedLink | Checks if user can toggle shared link mode. |
| 1.8.0 | canShowInfoDrawer | Checks if user can show **Info Drawer** for the selected node. |
| 1.8.0 | canManageFileVersions | Checks if user can manage file versions for the selected node. |
| 1.8.0 | canManagePermissions | Checks if user can manage permissions for the selected node. |
| 1.8.0 | canToggleEditOffline | Checks if user can toggle **Edit Offline** mode for selected node. |
| 1.8.0 | user.isAdmin | Checks if user is admin. |
| 1.9.0 | app.canShowLogout | Whether logout action should be present or not. |
| 1.12.0 | app.isLibraryManager | Checks if user is library manager. |

Expand All @@ -182,25 +162,13 @@ for example mixing `core.every` and `core.not`.
| Version | Key | Description |
| ------- | --------------------------------- | ---------------------------------------------------------------- |
| 1.7.0 | app.navigation.folder.canCreate | User can create content in the currently opened folder. |
| 1.7.0 | app.navigation.folder.canUpload | User can upload content to the currently opened folder. |
| 1.7.0 | app.navigation.isTrashcan | User is using the **Trashcan** page. |
| 1.7.0 | app.navigation.isNotTrashcan | Current page is not a **Trashcan**. |
| 1.7.0 | app.navigation.isLibraries | User is using a **Libraries** or **Library Search Result** page. |
| 1.7.0 | app.navigation.isNotLibraries | Current page is not a **Libraries** page. |
| 1.7.0 | app.navigation.isSharedFiles | User is using the **Shared Files** page. |
| 1.7.0 | app.navigation.isNotSharedFiles | Current page is not **Shared Files**. |
| 1.7.0 | app.navigation.isFavorites | User is using the **Favorites** page. |
| 1.7.0 | app.navigation.isNotFavorites | Current page is not **Favorites**. |
| 1.7.0 | app.navigation.isRecentFiles | User is using the **Recent Files** page. |
| 1.7.0 | app.navigation.isNotRecentFiles | Current page is not **Recent Files**. |
| 1.7.0 | app.navigation.isSearchResults | User is using the **Search Results** page. |
| 1.7.0 | app.navigation.isNotSearchResults | Current page is not the **Search Results**. |
| 1.7.0 | app.navigation.isSharedPreview | Current page is preview **Shared Files**. |
| 1.7.0 | app.navigation.isFavoritesPreview | Current page is preview **Favorites**. |
| 1.7.0 | app.navigation.isSharedFileViewer | Current page is shared file preview page. |
| 1.7.0 | app.navigation.isPreview | Current page is **Preview**. |
| 1.7.0 | app.navigation.isPersonalFiles | Current page is **Personal Files**. |
| 1.7.0 | app.navigation.isLibraryFiles | Current page is **Library Files**. |

**Tip:** See the [Registration](./registration) section for more details
on how to register your own entries to be re-used at runtime.
Expand Down
75 changes: 65 additions & 10 deletions extension.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,19 @@
"type": "string"
},
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
"description": "Rule/Set of rules to evaluate the visibility state",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minLength": 1
}
]
}
}
}
Expand Down Expand Up @@ -250,8 +261,19 @@
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
"description": "Rule/Set of rules to evaluate the visibility state",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minLength": 1
}
]
}
}
}
Expand Down Expand Up @@ -294,8 +316,19 @@
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
"description": "Rule/Set of rules to evaluate the visibility state",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minLength": 1
}
]
}
}
}
Expand Down Expand Up @@ -334,8 +367,19 @@
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
"description": "Rule/Set of rules to evaluate the visibility state",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minLength": 1
}
]
}
}
}
Expand Down Expand Up @@ -637,8 +681,19 @@
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
"description": "Rule/Set of rules to evaluate the visibility state",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minLength": 1
}
]
}
}
}
Expand Down
Loading
Loading