When adding a role to a subject, the application applies rules binding the type and role of the modification-initiating subject to the target type of the subject being assigned the role.
By adding roles, you can dynamically (during execution) expand the permissions of subjects.
The add_role
element can contain multiple rules. Rules are applied sequentially (the order is important) until the first rule that does not conflict with the combination of source_type
, source_role
, and target_type
values is found. In other words, to apply a rule, the following is required:
source_type
.source_role
.target_type
.Options for assigning a type to the subject that initiated addition of roles (source_type
element):
source_type: core
source_type: [core, dispatcher]
source_type: @any
Options for assigning a role to the subject that initiated addition of roles (source_role
element):
source_role: system
source_role: [system, user]
source_role: @any
Options for assigning the original type to the target subject (target_type
element):
original_type: core
original_type : @source_type
original_type: [core, dispatcher, @source_type]
original_type: @any
Options for assigning permissible roles to the target subject (target_role
element):
target_role: core
target_role: @source_role
target_role: [core, dispatcher]
target_role: @any
Example
add_role : [
{ source_type: dispatcher
, source_role: system
, target_type: [auditservice, fileservice]
, target_role: [user, admin]
},
]
Page top