mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
user options extension and rules
This commit is contained in:
@@ -27,6 +27,11 @@ import { RuleContext } from '@alfresco/adf-extensions';
|
||||
import * as navigation from './navigation.rules';
|
||||
import * as repository from './repository.rules';
|
||||
|
||||
export interface AcaRuleContext extends RuleContext {
|
||||
languagePicker: boolean;
|
||||
withCredentials: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if user can copy selected node.
|
||||
* JSON ref: `app.canCopyNode`
|
||||
@@ -526,3 +531,21 @@ export function canToggleFavorite(context: RuleContext): boolean {
|
||||
].some(Boolean)
|
||||
].every(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if application should render language picker menu.
|
||||
* JSON ref: `canShowLanguagePicker`
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canShowLanguagePicker(context: AcaRuleContext): boolean {
|
||||
return context.languagePicker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if application should render logout option.
|
||||
* JSON ref: `canShowLogout`
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export function canShowLogout(context: AcaRuleContext): boolean {
|
||||
return !context.withCredentials;
|
||||
}
|
||||
|
Reference in New Issue
Block a user