roles()
#
Available since 2.14.0
Loads roles into the app.
This method is idempotent. If a role is defined multiple times, only the last definition will be retained.
This method can only be used before the application is started.
roles(roles: JSONObject): void
Argument | Type | Description |
---|---|---|
roles | JSONObject | Object containing roles and their definitions. |
Usage #
app.import.roles({
roleA: {
controllers: {
controllerA: {
actions: {
actionA: true,
actionB: false,
}
},
controllerB: {
actions: {
'*': true
}
},
}
},
roleB: {
controllers: {
'*': {
actions: {
'*': true
}
}
},
},
})
Edit this page on Github (opens new window)