Difference between revisions of "Role extensions"
(→Documentation) (Tag: visualeditor) |
(→Inheritance) (Tag: visualeditor) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
== Parameters == | == Parameters == | ||
− | The parameter given is either an instance of the [[RoleExtensionParameter]] class or zero parameters. | + | The parameter given is either an instance of the [[RoleExtensionParameter class|RoleExtensionParameter]] class or zero parameters. |
If called with zero parameters, the script should return [[Role extensions#Documentation|documentation]] for itself. | If called with zero parameters, the script should return [[Role extensions#Documentation|documentation]] for itself. | ||
− | If the script is called with other parameters, then the script is not called via | + | If the script is called with other parameters, then the script is not called via the Role framework, which can be useful if scripts can be utilized for other functions. |
== Documentation == | == Documentation == | ||
When the role extension is called with zero parameters, it should return some documentation for itself. | When the role extension is called with zero parameters, it should return some documentation for itself. | ||
− | The documentation consists of a | + | The documentation consists of a [[RoleExtensionDocumentation class|RoleExtensionDocumentation]] class instance. |
− | + | Depending of the role extension works on users or roles, the actual value returned may be a [[RoleExtensionUserDocumentation class|RoleExtensionUserDocumentation]], or a [[RoleExtensionRoleDocumentation class|RoleExtensionRoleDocumentation]]. It is also possible to return a [[RoleExtensionEventDocumentation class|RoleExtensionEventDocumentation]] for those extensions that are event on changes to membership of a role, these are called automatically so documentation makes little sense. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Helper functions/classes == | == Helper functions/classes == | ||
Line 25: | Line 19: | ||
== Discovery of role extensions == | == Discovery of role extensions == | ||
Role extensions are discovered in the following order: | Role extensions are discovered in the following order: | ||
− | # Workflow | + | # Workflow scripts may be defined in folders named "Role exts" anywhere in the system. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
# If the current user does not have read access to the role extension itself, then the extension is ignored. | # If the current user does not have read access to the role extension itself, then the extension is ignored. | ||
− | # If | + | # If the documentation has LimitToPath, then that is examined to filter out if not applicable to current role. |
[[Category:Roles]] | [[Category:Roles]] |
Latest revision as of 13:53, 20 December 2019
Role extensions are extensions points for a role.
Parameters
The parameter given is either an instance of the RoleExtensionParameter class or zero parameters.
If called with zero parameters, the script should return documentation for itself.
If the script is called with other parameters, then the script is not called via the Role framework, which can be useful if scripts can be utilized for other functions.
Documentation
When the role extension is called with zero parameters, it should return some documentation for itself.
The documentation consists of a RoleExtensionDocumentation class instance.
Depending of the role extension works on users or roles, the actual value returned may be a RoleExtensionUserDocumentation, or a RoleExtensionRoleDocumentation. It is also possible to return a RoleExtensionEventDocumentation for those extensions that are event on changes to membership of a role, these are called automatically so documentation makes little sense.
Helper functions/classes
Discovery of role extensions
Role extensions are discovered in the following order:
- Workflow scripts may be defined in folders named "Role exts" anywhere in the system.
- If the current user does not have read access to the role extension itself, then the extension is ignored.
- If the documentation has LimitToPath, then that is examined to filter out if not applicable to current role.