File tree Expand file tree Collapse file tree 16 files changed +362
-1
lines changed
src/Umbraco.Web.UI.Client
src/packages/user/user-permission
fallback-permission-condition Expand file tree Collapse file tree 16 files changed +362
-1
lines changed Original file line number Diff line number Diff line change 1+ // eslint-disable-next-line @typescript-eslint/naming-convention
2+ export const EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_1 = 'Example.Dictionary.Action1' ;
3+ // eslint-disable-next-line @typescript-eslint/naming-convention
4+ export const EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_2 = 'Example.Dictionary.Action2' ;
Original file line number Diff line number Diff line change 1+ import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action' ;
2+
3+ export class ExampleAction1EntityAction extends UmbEntityActionBase < never > {
4+ override async execute ( ) {
5+ alert ( 'Example action 1 executed' ) ;
6+ }
7+ }
8+
9+ export { ExampleAction1EntityAction as default } ;
Original file line number Diff line number Diff line change 1+ import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action' ;
2+
3+ export class ExampleAction2EntityAction extends UmbEntityActionBase < never > {
4+ override async execute ( ) {
5+ alert ( 'Example action 2 executed' ) ;
6+ }
7+ }
8+
9+ export { ExampleAction2EntityAction as default } ;
Original file line number Diff line number Diff line change 1+ import {
2+ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_1 ,
3+ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_2 ,
4+ } from '../constants.js' ;
5+ import { UMB_DICTIONARY_ENTITY_TYPE } from '@umbraco-cms/backoffice/dictionary' ;
6+ import { UMB_FALLBACK_USER_PERMISSION_CONDITION_ALIAS } from '@umbraco-cms/backoffice/user-permission' ;
7+
8+ export const manifests : Array < UmbExtensionManifest > = [
9+ {
10+ type : 'entityAction' ,
11+ kind : 'default' ,
12+ alias : 'Example.EntityAction.Action1' ,
13+ name : 'Action 1 Entity Action' ,
14+ forEntityTypes : [ UMB_DICTIONARY_ENTITY_TYPE ] ,
15+ api : ( ) => import ( './action-1.js' ) ,
16+ weight : 10000 ,
17+ meta : {
18+ label : 'Action 1' ,
19+ icon : 'icon-car' ,
20+ } ,
21+ conditions : [
22+ {
23+ alias : UMB_FALLBACK_USER_PERMISSION_CONDITION_ALIAS ,
24+ allOf : [ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_1 ] ,
25+ } ,
26+ ] ,
27+ } ,
28+ {
29+ type : 'entityAction' ,
30+ kind : 'default' ,
31+ alias : 'Example.EntityAction.Action2' ,
32+ name : 'Action 2 Entity Action' ,
33+ forEntityTypes : [ UMB_DICTIONARY_ENTITY_TYPE ] ,
34+ api : ( ) => import ( './action-2.js' ) ,
35+ weight : 9000 ,
36+ meta : {
37+ label : 'Action 2' ,
38+ icon : 'icon-bus' ,
39+ } ,
40+ conditions : [
41+ {
42+ alias : UMB_FALLBACK_USER_PERMISSION_CONDITION_ALIAS ,
43+ allOf : [ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_2 ] ,
44+ } ,
45+ ] ,
46+ } ,
47+ ] ;
Original file line number Diff line number Diff line change 1+ import {
2+ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_1 ,
3+ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_2 ,
4+ } from '../constants.js' ;
5+ import { UMB_DICTIONARY_ENTITY_TYPE } from '@umbraco-cms/backoffice/dictionary' ;
6+
7+ export const manifests : Array < UmbExtensionManifest > = [
8+ {
9+ type : 'entityUserPermission' ,
10+ alias : 'Example.EntityUserPermission.Entity.Action1' ,
11+ name : 'Action 1 for Entity User Permission' ,
12+ forEntityTypes : [ UMB_DICTIONARY_ENTITY_TYPE ] ,
13+ meta : {
14+ verbs : [ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_1 ] ,
15+ label : 'Action 1' ,
16+ description : 'Description for action 1' ,
17+ } ,
18+ } ,
19+ {
20+ type : 'entityUserPermission' ,
21+ alias : 'Example.EntityUserPermission.Entity.Action2' ,
22+ name : 'Action 2 for Entity User Permission' ,
23+ forEntityTypes : [ UMB_DICTIONARY_ENTITY_TYPE ] ,
24+ meta : {
25+ verbs : [ EXAMPLE_USER_PERMISSION_DICTIONARY_ACTION_2 ] ,
26+ label : 'Action 2' ,
27+ description : 'Description for action 2' ,
28+ } ,
29+ } ,
30+ ] ;
Original file line number Diff line number Diff line change 1+ import { manifests as entityUserPermissionManifests } from './entity-user-permission/manifests.js' ;
2+ import { manifests as entityActionManifests } from './entity-action/manifests.js' ;
3+ import { manifests as localizationManifests } from './localization/manifests.js' ;
4+
5+ export const manifests : Array < UmbExtensionManifest > = [
6+ ...entityUserPermissionManifests ,
7+ ...entityActionManifests ,
8+ ...localizationManifests ,
9+ ] ;
Original file line number Diff line number Diff line change 1+ export default {
2+ user : {
3+ // eslint-disable-next-line @typescript-eslint/naming-convention
4+ permissionsEntityGroup_dictionary : 'Dictionary' ,
5+ } ,
6+ } ;
Original file line number Diff line number Diff line change 1+ export const manifests : Array < UmbExtensionManifest > = [
2+ {
3+ type : 'localization' ,
4+ alias : 'Example.UserPermission.Localization.En' ,
5+ name : 'en-US User Permission Localization Example' ,
6+ js : ( ) => import ( './en.js' ) ,
7+ weight : 1 ,
8+ meta : {
9+ culture : 'en' ,
10+ } ,
11+ } ,
12+ ] ;
Original file line number Diff line number Diff line change 1+ export * from './fallback-permission-condition/constants.js' ;
Original file line number Diff line number Diff line change 1+ export const UMB_FALLBACK_USER_PERMISSION_CONDITION_ALIAS = 'Umb.Condition.UserPermission.Fallback' ;
You can’t perform that action at this time.
0 commit comments