mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Rollback visibility rules cleanup (#4426)
* Revert "[ACS-9369] Updated rule-migration-guide.md to include missed rule (#4420)" This reverts commitb3e2af7f0f
. * Revert "[ACS-9369] Resolved issues where visibility rules with a single element array would log errors (#4416)" This reverts commit4e33f1126d
. * Revert "[ACS-8694] Cleanup of visibility rules for extensions in ACA (#4140)" This reverts commitf1c4dcf45d
.
This commit is contained in:
@@ -1,142 +0,0 @@
|
||||
----
|
||||
Title: Legacy Rules for ACA
|
||||
----
|
||||
|
||||
# Legacy rules
|
||||
|
||||
Below is a list of all unused rules that were removed with ACA 5.1.1. You may use them as a reference in case your application/extension is still dependent on them,
|
||||
however we do advise that you revisit those implementations and substitute them with a different approach, since these rules will no longer be supported.
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* app.selection.file.canLock
|
||||
* Checks if user can lock selected file.
|
||||
*/
|
||||
export const canLockFile = (context: RuleContext): boolean => !isWriteLocked(context) && canUpdateSelectedNode(context);
|
||||
|
||||
/**
|
||||
* app.selection.file.canUnlock
|
||||
* Checks if user can unlock selected file.
|
||||
*/
|
||||
export function canUnlockFile(context: RuleContext): boolean {
|
||||
const { file } = context.selection;
|
||||
return isWriteLocked(context) && (context.permissions.check(file?.entry, ['delete']) || isUserWriteLockOwner(context));
|
||||
}
|
||||
|
||||
/**
|
||||
* app.selection.file.isLockOwner
|
||||
* Checks if the selected file has **write** or **read-only** locks specified,
|
||||
* and that current user is the owner of the lock.
|
||||
*/
|
||||
export const isUserWriteLockOwner = (context: RuleContext): boolean =>
|
||||
isWriteLocked(context) &&
|
||||
context.selection.file?.entry.properties['cm:lockOwner'] &&
|
||||
context.selection.file?.entry.properties['cm:lockOwner'].id === context.profile.id;
|
||||
|
||||
/**
|
||||
* app.selection.file.canShare
|
||||
* Checks if user can share selected file.
|
||||
*/
|
||||
export const canShareFile = (context: RuleContext): boolean =>
|
||||
[context.selection.file, navigation.isNotTrashcan(context), repository.hasQuickShareEnabled(context), !isShared(context)].every(Boolean);
|
||||
|
||||
/**
|
||||
* app.selection.canUnshare
|
||||
* Checks if user can un-share selected nodes.
|
||||
*/
|
||||
export function canUnshareNodes(context: RuleContext): boolean {
|
||||
if (hasSelection(context)) {
|
||||
return context.permissions.check(context.selection.nodes, ['delete'], {
|
||||
target: 'allowableOperationsOnTarget'
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* app.selection.file.isShared
|
||||
* Checks if the selected file is already shared.
|
||||
*/
|
||||
export function isShared(context: RuleContext): boolean {
|
||||
if (navigation.isSharedFiles(context) && context.selection.file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (navigation.isNotTrashcan(context) && hasSelection(context) && context.selection.file) {
|
||||
return !!context.selection.file.entry?.properties?.['qshare:sharedId'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* app.selection.isPrivateLibrary
|
||||
* Checks if user has selected a **private** library (site)
|
||||
*/
|
||||
export function isPrivateLibrary(context: RuleContext): boolean {
|
||||
return context.selection.library?.entry?.visibility === 'PRIVATE';
|
||||
}
|
||||
|
||||
/**
|
||||
* app.selection.hasNoLibraryRole
|
||||
* Checks if the selected library has no **role** property defined.
|
||||
*/
|
||||
export const hasNoLibraryRole = (context: RuleContext): boolean => !hasLibraryRole(context);
|
||||
|
||||
/**
|
||||
* app.navigation.isLibraryFiles
|
||||
* Checks if a **Library Files** route is activated.
|
||||
*/
|
||||
export function isLibraryFiles(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.startsWith('/libraries');
|
||||
}
|
||||
|
||||
/**
|
||||
* app.navigation.isPersonalFiles
|
||||
* Checks if a **Personal Files** route is activated.
|
||||
*/
|
||||
export function isPersonalFiles(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.startsWith('/personal-files');
|
||||
}
|
||||
|
||||
/**
|
||||
* app.navigation.isSharedPreview
|
||||
* Checks if a **Shared Preview** route is activated.
|
||||
*/
|
||||
export function isSharedPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.startsWith('/shared/preview/') || (url?.startsWith('/shared') && url?.includes('viewer:view'));
|
||||
}
|
||||
|
||||
/**
|
||||
* app.navigation.isFavoritesPreview
|
||||
* Checks if a **Favorites Preview** route is activated.
|
||||
*/
|
||||
export function isFavoritesPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.startsWith('/favorites/preview/') || (url?.startsWith('/favorites') && url?.includes('viewer:view'));
|
||||
}
|
||||
|
||||
/**
|
||||
* app.navigation.isSharedFileViewer
|
||||
* Checks if a **Shared File Preview** route is activated.
|
||||
*/
|
||||
export function isSharedFileViewer(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.startsWith('/preview/s/');
|
||||
}
|
||||
|
||||
/**
|
||||
* repository.isQuickShareEnabled
|
||||
* Checks if the quick share repository option is enabled or not.
|
||||
*/
|
||||
export const hasQuickShareEnabled = (context: RuleContext): boolean => context.repository.status.isQuickShareEnabled;
|
||||
|
||||
/**
|
||||
* user.isAdmin
|
||||
* Checks if user is admin.
|
||||
*/
|
||||
export const isAdmin = (context: RuleContext): boolean => context.profile.isAdmin;
|
||||
```
|
@@ -1,130 +0,0 @@
|
||||
---
|
||||
Title: Rule Migration Guide
|
||||
---
|
||||
|
||||
# Migrating rules to be ACA 5.1.1 compatible
|
||||
|
||||
As part of cleanup of the evaluators section in ACA 5.1.1, several rules from the application were removed and
|
||||
replaced with their alternatives. The biggest change involves the preference to use array based visibility rules
|
||||
instead of string based. What this means is that developers will now be able to provide a set of smaller visibility
|
||||
rules via array, instead of having to provide one single rule, which would internally call multiple smaller rules
|
||||
via code.
|
||||
|
||||
For e.g., for a rule `app.canManageFileVersions`, which was basically a combination of `hasFileSelection(app.selection.file)`,
|
||||
`isNotTrashcan (app.navigation.isNotTrashcan)`, and `isNotLocked(app.selection.file.isNotLocked)`, earlier, the code
|
||||
used to look something like -
|
||||
|
||||
app.extensions.json
|
||||
|
||||
```json
|
||||
{
|
||||
"rules": {
|
||||
"visible": "canManageFileVersions"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
aca-content.module.ts -
|
||||
|
||||
```ts
|
||||
extensions.setEvaluators({
|
||||
'app.canManageFileVersions': rules.canManageFileVersions,
|
||||
'app.selection.file': rules.hasFileSelection,
|
||||
'app.navigation.isNotTrashcan': rules.isNotTrashcan,
|
||||
'app.navigation.isTrashcan': rules.isTrashcan,
|
||||
'app.selection.file.isNotLocked': rules.isNotLocked
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
app.rules.ts -
|
||||
|
||||
```ts
|
||||
import { isTrashcan } from './navigation.rules';
|
||||
|
||||
export const rules = {
|
||||
canManageFileVersions: () => hasFileSelection() && isNotTrashcan() && isNotLocked(),
|
||||
hasFileSelection: (context) => !!context?.selection?.file,
|
||||
isTrashcan: (context) => context.navigation.startsWith('/trashcan'),
|
||||
isNotTrashcan: (context) => !isTrashcan(context),
|
||||
isNotLocked: (context) => context.selection.file.entry.isLocked || context.selection.file.entry.properties?.['cm:lockType'] === 'READ_ONLY_LOCK'
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
|
||||
Now, the visibility of this extension unit can be controlled in more compact way -
|
||||
|
||||
```json
|
||||
{
|
||||
"rules": {
|
||||
"visible": [
|
||||
"app.selection.file",
|
||||
"!app.navigation.isTrashcan",
|
||||
"!app.selection.file.isLocked"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
No further changes in aca-content.module.ts, or app.rules.ts is required, apart from removing the unused rules and functions
|
||||
|
||||
**NOTE**: Notice the use of the rule negation `!` in the app.navigation.isTrashcan rule above, thereby removing another unneeded rule.
|
||||
|
||||
Below is a full list of rules that would need to be migrated, along with the corresponding set of rules that can be used in their place. Do note that the default OOTB ACA already has the migrations applied on extensions.json, and the changes would
|
||||
only need to be done on any extensions configuration that is custom to you. All old migrated rules have been removed from the code base, so performing this migration is necessary in order to ensure a stable Alfresco Content Application experience
|
||||
|
||||
| Old rule | New Rule |
|
||||
|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| app.navigation.isNotTrashcan | !app.navigation.isTrashcan |
|
||||
| app.navigation.isNotFavorites | !app.navigation.isFavorites |
|
||||
| app.navigation.isNotSharedFiles | !app.navigation.isSharedFiles |
|
||||
| app.navigation.isNotLibraries | !app.navigation.isLibraries |
|
||||
| app.navigation.isNotRecentFiles | !app.navigation.isRecentFiles |
|
||||
| app.navigation.isNotSearchResults | !app.navigation.isSearchResults |
|
||||
| canViewFile | app.selection.file<br/>!app.navigation.isTrashcan |
|
||||
| app.canCreateLibrary | app.isContentServiceEnabled<br/>app.navigation.isLibraries |
|
||||
| app.selection.canDownload | app.selection.notEmpty<br/>!app.navigation.isTrashcan<br/>app.selection.canDownload |
|
||||
| isTrashcanItemSelected | app.navigation.isTrashcan<br/>app.selection.notEmpty |
|
||||
| canLeaveLibrary | app.selection.library<br/>app.selection.hasLibraryRole |
|
||||
| canShowInfoDrawer | app.selection.notEmpty<br/>!app.navigation.isLibraries<br/>!app.navigation.isTrashcan |
|
||||
| app.toolbar.favorite.canEditMetadata | app.selection.library<br/>app.selection.library<br/>isLibraryManager |
|
||||
| canToggleEditOffline | app.selection.file<br/>!app.navigation.isTrashcan<br/>canToggleFileLock |
|
||||
| canEditFolder | app.selection.folder.canUpdate<br/>!app.navigation.isTrashcan |
|
||||
| app.toolbar.favorite.canAdd | app.selection.notEmpty<br/>app.selection.canAddFavorite<br/>!app.navigation.isTrashcan<br/>!app.navigation.isRecentFiles<br/>!app.navigation.isSharedFiles<br/>!app.navigation.isSearchResults<br/>!app.navigation.isFavorites |
|
||||
| app.toolbar.favorite.canRemove | app.selection.notEmpty<br/>app.selection.canRemoveFavorite<br/>!app.navigation.isTrashcan<br/>!app.navigation.isRecentFiles<br/>!app.navigation.isSharedFiles<br/>!app.navigation.isSearchResults<br/>!app.navigation.isFavorites |
|
||||
| canCopyNode | app.selection.notEmpty<br/>!app.navigation.isTrashcan<br/>!app.navigation.isLibraries |
|
||||
| canManageFileVersions | app.selection.file<br/>!app.navigation.isTrashcan<br/>!app.selection.file.isLocked |
|
||||
| canManagePermissions | app.selection.first.canUpdate<br/>!app.navigation.isTrashcan<br/>!isSmartFolder<br/>!isMultiSelection |
|
||||
| rules.canManageFolderRules | rules.isFolderRulesEnabled<br/>app.selection.folder.canUpdate<br/>!app.navigation.isTrashcan<br/>app.selection.folder<br/>!app.navigation.isFavorites<br/>!isSmartFolder |
|
||||
| app.navigation.folder.canCreate | app.isContentServiceEnabled<br/>app.navigation.folder.canCreate |
|
||||
| app.navigation.folder.canUpload | app.isContentServiceEnabled<br/>app.navigation.folder.canCreate |
|
||||
| app.isUploadSupported | app.isContentServiceEnabled<br/>app.navigation.folder.canCreate |
|
||||
| canToggleSharedLink | app.selection.file<br/>canToggleSharedLink |
|
||||
| canToggleJoinLibrary | app.selection.library<br/>!app.selection.hasLibraryRole<br/>canToggleJoinLibrary |
|
||||
| canShowExpand | !app.navigation.isLibraries<br/>!app.navigation.isDetails |
|
||||
| canInfoPreview | app.navigation.isSearchResults<br/>!isMultiSelection<br/>!app.selection.folder<br/>!app.navigation.isPreview |
|
||||
| app.selection.canDelete | !app.navigation.isTrashcan<br/>!app.navigation.isLibraries<br/>app.selection.notEmpty<br/>app.selection.canDelete |
|
||||
| isLibraryManager | app.selection.library<br/>isLibraryManager |
|
||||
|
||||
In addition to the above-mentioned migrations, the following set of rules were removed from the ACA codebase, since they were not being used by the application. If you still need access to these rules however, the original implementation
|
||||
can be found in [legacy-rules.md](./legacy-rules.md). However, do note that since these rules have been removed from the ACA codebase, no support will be provided for them in the future. We advise that you should only use the provided rules as reference,
|
||||
and migrate your current implementation to use a different approach instead.
|
||||
|
||||
| Rule |
|
||||
|-----------------------------------|
|
||||
| app.selection.file.canLock |
|
||||
| app.selection.file.canUnlock |
|
||||
| app.selection.file.isLockOwner |
|
||||
| app.selection.file.canShare |
|
||||
| app.selection.file.isShared |
|
||||
| app.selection.canUnshare |
|
||||
| app.selection.isPrivateLibrary |
|
||||
| app.selection.hasNoLibraryRole |
|
||||
| app.navigation.isLibraryFiles |
|
||||
| app.navigation.isPersonalFiles |
|
||||
| app.navigation.isSharedPreview |
|
||||
| app.navigation.isFavoritesPreview |
|
||||
| app.navigation.isSharedFileViewer |
|
||||
| repository.isQuickShareEnabled |
|
||||
| user.isAdmin |
|
@@ -1,78 +0,0 @@
|
||||
---
|
||||
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. |
|
||||
|
||||
|
@@ -195,11 +195,84 @@ You can now declare a toolbar button action that is based on the rule above.
|
||||
|
||||
The button will be visible only when the linked rule evaluates to `true`.
|
||||
|
||||
## Application Evaluators
|
||||
|
||||
**Tips:**
|
||||
1. You can also negate any rule by utilizing a `!` prefix: `!app.navigation.isTrashcan` is the opposite of the `app.navigation.isTrashcan`.
|
||||
2. See the [Registration](./registration) section for more details on how to register your own entries to be re-used at runtime.
|
||||
3. See [Rules List](./rules-list.md) for a full list of rules available with the Alfresco Content 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.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. |
|
||||
|
||||
## Navigation Evaluators
|
||||
|
||||
The application exposes a set of navigation-related evaluators to help developers restrict or enable certain actions based on the route or page displayed.
|
||||
|
||||
The negated evaluators are provided just to simplify development, and to avoid having complex rule trees just to negate the rules,
|
||||
for example mixing `core.every` and `core.not`.
|
||||
|
||||
**Tip:** You can also negate any rule by utilizing a `!` prefix:
|
||||
`!app.navigation.isTrashcan` is the opposite of the `app.navigation.isTrashcan`.
|
||||
|
||||
| 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**. |
|
||||
| 5.3.0 | app.navigation.isNotDetails | Current page is not **Details**. |
|
||||
|
||||
**Tip:** See the [Registration](./registration) section for more details
|
||||
on how to register your own entries to be re-used at runtime.
|
||||
|
||||
### Example
|
||||
|
||||
|
Reference in New Issue
Block a user