Difference between revisions of "Role extensions"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "Role extensions are extensions points for a role. == Parameters == == Documentation == == Inheritance == == Helper functions/classes == == Discovery of role extensions ==...")
(Tag: visualeditor)
 
(Tag: visualeditor)
Line 2: Line 2:
  
 
== Parameters ==
 
== Parameters ==
 +
The parameter given is either an instance of the [[RoleExtensionParameter]] class or zero parameters.
 +
 +
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 theRole framework, which can be useful if scripts can be utilized for other functions.
  
 
== Documentation ==
 
== Documentation ==
Line 17: Line 22:
 
#* \Products\R1
 
#* \Products\R1
 
#* \R1
 
#* \R1
# Generic scripts may be defined in folders named "Role exts" in any of the parents. I.E. followng the example from above the following folders are examined:
+
# Generic scripts may be defined in folders named "Role exts" in any of the parents. I.E. following the example from above the following folders are examined:
 
#* \Products\Dashboard1\Company A\Dept B\Role exts
 
#* \Products\Dashboard1\Company A\Dept B\Role exts
 
#* \Products\Dashboard1\Company A\Role exts
 
#* \Products\Dashboard1\Company A\Role exts
Line 25: Line 30:
 
# 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 multiple role extensions are found with the same name, then only the first one found is "discovered". But it is possible inside a role extension to call the "parent" version of the role extension.
 
# If multiple role extensions are found with the same name, then only the first one found is "discovered". But it is possible inside a role extension to call the "parent" version of the role extension.
 +
[[Category:Roles]]

Revision as of 06:13, 10 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 theRole framework, which can be useful if scripts can be utilized for other functions.

Documentation

Inheritance

Helper functions/classes

Discovery of role extensions

Role extensions are discovered in the following order:

  1. Workflow scripts that are children of roles in parent folders with same name. I.E. if the current role is named R1, and is located in the Path \Products\Dashboard1\Company A\Dept B, then it will look for role extensions in
    • \Products\Dashboard1\Company A\Dept B\R1
    • \Products\Dashboard1\Company A\R1
    • \Products\Dashboard1\R1
    • \Products\R1
    • \R1
  2. Generic scripts may be defined in folders named "Role exts" in any of the parents. I.E. following the example from above the following folders are examined:
    • \Products\Dashboard1\Company A\Dept B\Role exts
    • \Products\Dashboard1\Company A\Role exts
    • \Products\Dashboard1\Role exts
    • \Products\Role exts
    • \Role exts
  3. If the current user does not have read access to the role extension itself, then the extension is ignored.
  4. If multiple role extensions are found with the same name, then only the first one found is "discovered". But it is possible inside a role extension to call the "parent" version of the role extension.