Class: I2CE PermissionParser (Development): Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
This article describes the class ''I2CE_PermissionParser'' . | This article describes the class ''I2CE_PermissionParser'' . | ||
*Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_Fuzzy]]. | *Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_Fuzzy]]. | ||
*Location: Part of the module [[I2CE Module List (Development)# | *Location: Part of the module [[I2CE Module List (Development)#permissions|permissions]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev | ||
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L29 modules/Permissions/lib/I2CE_PermissionParser.php] on line 29 | ||
==Variables== | ==Variables== | ||
===$user=== | ===$user=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L31 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 31 | ||
*Type: protected $user | *Type: protected $user | ||
===$template=== | ===$template=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L32 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 32 | ||
*Type: protected $template | *Type: protected $template | ||
===$has_get_data=== | ===$has_get_data=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L33 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 33 | ||
*Type: protected $has_get_data | *Type: protected $has_get_data | ||
===$has_get_display=== | ===$has_get_display=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L34 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 34 | ||
*Type: protected $has_get_display | *Type: protected $has_get_display | ||
===$task_trickle_down=== | |||
A cached array of the task trickle down data. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L38 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 38 | |||
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $task_trickle_down | |||
===$task_trickle_up=== | |||
The reverse of the trickle down array. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L42 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 42 | |||
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $task_trickle_up | |||
===$role_trickle_up=== | |||
The role_trickle_up data cached for faster access. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L46 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 46 | |||
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $role_trickle_up | |||
===$role_tasks=== | |||
A list of tasks given by a role. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L50 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 50 | |||
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $role_tasks | |||
===$role_has_task=== | |||
A cache of tasks a role can access for repeated checkes. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L54 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 54 | |||
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $role_has_task | |||
==Methods== | ==Methods== | ||
===__construct()=== | ===__construct()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L57 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 57 | ||
*Signature: public function __construct($template | *Signature: public function __construct($template) | ||
*Parameters: | *Parameters: | ||
**$template | **$template | ||
===evaluateBooleans()=== | ===evaluateBooleans()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L830 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 830 | ||
*Signature: protected function evaluateBooleans($booleans) | *Signature: protected function evaluateBooleans($booleans) | ||
*Parameters: | *Parameters: | ||
**$booleans | **$booleans | ||
===getRoleHasTask()=== | |||
Return the permitted value from the role/task cache. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L117 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 117 | |||
*Signature: static protected function getRoleHasTask($role,$task) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $role | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $task | |||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | |||
===getRoleTasks()=== | |||
Return the array of tasks that are directly given by a role. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L136 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 136 | |||
*Signature: static protected function getRoleTasks($user_role) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $user_role | |||
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] | |||
===getRoleTrickleUp()=== | ===getRoleTrickleUp()=== | ||
Returns the role trickle up from the shortname | Returns the role trickle up from the shortname | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L385 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 385 | ||
*Signature: protected function getRoleTrickleUp($name) | *Signature: static protected function getRoleTrickleUp($name) | ||
*Parameters: | *Parameters: | ||
** [http://www.php.net/manual/en/language.types.string.php string ] $name <br/>the role shortname | ** [http://www.php.net/manual/en/language.types.string.php string ] $name <br/>the role shortname | ||
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>(an empty array if there is no such tag name) | *Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>(an empty array if there is no such tag name) | ||
===hasPermission()=== | ===hasPermission()=== | ||
Check to see if a user has permission for a given role/task whatever @param string $permissions The permisisions string. Example: "role(admin) or task(can_view_page) or task(can_edit_page)" Exmaple: "role(admin|staff)" is the same as "role(admin,staff)" which is the same as "role(admin) role(staff)" which is the same as "role(admin) | role(staff)" which is the same as "role(admin) or role(staff)" Example: "role(admin) or task(can_view_page) and role(staff)" is the same as "(role(admin) or task(can_view_page)) and role(staff)" i.e. parenthesis are grouped left. Note: You may reference variables, which is really template data, as a function argument or in a double quoted string. When referencing varaibles, you are allowed to include types, such as ${T1}z, but you are not allowed to do so in a doulbe quoted string. Variable names may consit of alpha-numeric character, '_', and '-'. You may protect a variable by surrounding it in {}'s Example: "func1($a,"x$a", '\' "' "x{$a}y" , "x{$ay} ${T1}z )" causes the (possbily fuzzy) method hasPermission_func1() with the following arguments: array( $this->template->getDisplayData('a',$node), 'x' . $this->template->getDisplayData('a',$node), '\' "', 'x' . $this->template->getDisplayData('ay',$node) , 'x' . $this->template->getDisplayData('a',$node) . 'y', 'x' . $this->template->getData('T1',z,$node,true,true)) There are special argument you can pass to the function which are <TEMPLATE>, <USER> and <NODE> which will be the template, user and calling node associated with this permission. Note: spaces provide an implicit comma to split arguments. Example functions: role, task which take a list or roles and task repsectively. Example function: form('person' method <USER>) -- finds the person form,relative to $node and calls $form->method | Check to see if a user has permission for a given role/task whatever @param string $permissions The permisisions string. Example: "role(admin) or task(can_view_page) or task(can_edit_page)" Example: "ModuleName->Method(admin) will call Method in the module ModuleName with arguemnts ('admin') Exmaple: "role(admin|staff)" is the same as "role(admin,staff)" which is the same as "role(admin) role(staff)" which is the same as "role(admin) | role(staff)" which is the same as "role(admin) or role(staff)" Example: "role(admin) or task(can_view_page) and role(staff)" is the same as "(role(admin) or task(can_view_page)) and role(staff)" i.e. parenthesis are grouped left. Note: You may reference variables, which is really template data, as a function argument or in a double quoted string. When referencing varaibles, you are allowed to include types, such as ${T1}z, but you are not allowed to do so in a doulbe quoted string. Variable names may consit of alpha-numeric character, '_', and '-'. You may protect a variable by surrounding it in {}'s Example: "func1($a,"x$a", '\' "' "x{$a}y" , "x{$ay} ${T1}z )" causes the (possbily fuzzy) method hasPermission_func1() with the following arguments: array( $this->template->getDisplayData('a',$node), 'x' . $this->template->getDisplayData('a',$node), '\' "', 'x' . $this->template->getDisplayData('ay',$node) , 'x' . $this->template->getDisplayData('a',$node) . 'y', 'x' . $this->template->getData('T1',z,$node,true,true)) There are special argument you can pass to the function which are <TEMPLATE>, <USER> and <NODE> which will be the template, user and calling node associated with this permission. Note: spaces provide an implicit comma to split arguments. Example functions: role, task which take a list or roles and task repsectively. Example function: form('person' method <USER>) -- finds the person form,relative to $node and calls $form->method($user) Example function: form(person , 'weird method;',<USER>10) -- finds the person form,relative to $node and calls $form->$method($user,10) where $method='weird method;' Example function: module('mod_name',method,arg1,...,argn) works like form but for modules | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L227 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 227 | ||
*Signature: public function hasPermission($permission,$node) | *Signature: public function hasPermission($permission,$node) | ||
*Parameters: | *Parameters: | ||
Line 57: | Line 89: | ||
*Returns: mixed.<br/>True/false, or null on failure. | *Returns: mixed.<br/>True/false, or null on failure. | ||
===hasPermission_role()=== | ===hasPermission_role()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L397 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 397 | ||
*Signature: protected function hasPermission_role($node,$roles) | *Signature: protected function hasPermission_role($node,$roles) | ||
*Parameters: | *Parameters: | ||
Line 63: | Line 95: | ||
**$roles | **$roles | ||
===hasPermission_task()=== | ===hasPermission_task()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L323 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 323 | ||
*Signature: protected function hasPermission_task($node,$tasks) | *Signature: protected function hasPermission_task($node,$tasks) | ||
*Parameters: | *Parameters: | ||
**$node | **$node | ||
**$tasks | **$tasks | ||
===hasPermission_user()=== | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L448 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 448 | |||
*Signature: protected function hasPermission_user($node,$users) | |||
*Parameters: | |||
**$node | |||
**$users | |||
===hasPermsssion_module()=== | ===hasPermsssion_module()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L269 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 269 | ||
*Signature: protected function hasPermsssion_module($node,$args) | *Signature: protected function hasPermsssion_module($node,$args) | ||
*Parameters: | *Parameters: | ||
Line 75: | Line 113: | ||
**$args | **$args | ||
===hasRole()=== | ===hasRole()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L239 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 239 | ||
*Signature: public function hasRole($role,$node) | *Signature: public function hasRole($role,$node) | ||
*Parameters: | *Parameters: | ||
Line 82: | Line 120: | ||
***Default Value: null | ***Default Value: null | ||
===hasTask()=== | ===hasTask()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L253 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 253 | ||
*Signature: public function hasTask($task,$node) | *Signature: public function hasTask($task,$node) | ||
*Parameters: | *Parameters: | ||
Line 89: | Line 127: | ||
***Default Value: null | ***Default Value: null | ||
===parsePermissionsLogic()=== | ===parsePermissionsLogic()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L487 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 487 | ||
*Signature: protected function parsePermissionsLogic($permission,$node) | *Signature: protected function parsePermissionsLogic($permission,$node) | ||
*Parameters: | *Parameters: | ||
**&$permission | **&$permission | ||
**$node | **$node | ||
===setRoleHasTask()=== | |||
Add a task as permitted for a given role as well as all tasks it trickles down to recursively if the permission is allowed (true). | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L93 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 93 | |||
*Signature: static protected function setRoleHasTask($role,$task) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $role | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $task | |||
===setupTrickleDown()=== | |||
Set up the trickle down static array if it hasn't been set. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L69 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 69 | |||
*Signature: static protected function setupTrickleDown($override) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $override <br/>Override what's there if true | |||
***Default Value: false | |||
===taskExists()=== | |||
Checks to see if the given task is defined in they system | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L293 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 293 | |||
*Signature: static public function taskExists($task) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $task | |||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | |||
===taskHasAlternateSatisfaction()=== | |||
Checks to see if a given task has an alternative way of being satisfied. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Permissions/lib/I2CE_PermissionParser.php#L302 i2ce/modules/Permissions/lib/I2CE_PermissionParser.php] on line 302 | |||
*Signature: protected function taskHasAlternateSatisfaction($node,$task) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $task | |||
==Inherited Methods== | ==Inherited Methods== | ||
===_hasMethod()=== | ===_hasMethod()=== | ||
Line 101: | Line 167: | ||
This method is inherited from [[Class: I2CE_Fuzzy (Development)#userMessage() | I2CE_Fuzzy->userMessage()]] | This method is inherited from [[Class: I2CE_Fuzzy (Development)#userMessage() | I2CE_Fuzzy->userMessage()]] | ||
==Fuzzy Methods== | ==Fuzzy Methods== | ||
===hasPermission_userSatisfies()=== | |||
This method is implemented by [[Class: iHRIS_Module_SelfService (Development)#hasPermission_userSatisfies() | iHRIS_Module_SelfService->hasPermission_userSatisfies() ]] | |||
===hasPermission_satisfies()=== | |||
This method is implemented by [[Class: I2CE_Module_FormRelationshipBasedPermissions (Development)#hasPermission_satisfies() | I2CE_Module_FormRelationshipBasedPermissions->hasPermission_satisfies() ]] | |||
===hasPermission_form()=== | ===hasPermission_form()=== | ||
This method is implemented by [[Class: I2CE_Module_Forms (Development)#hasPermission_form() | I2CE_Module_Forms->hasPermission_form() ]] | This method is implemented by [[Class: I2CE_Module_Forms (Development)#hasPermission_form() | I2CE_Module_Forms->hasPermission_form() ]] |
Latest revision as of 08:18, 6 May 2015
This article describes the class I2CE_PermissionParser .
- Extends the class: I2CE_Fuzzy.
- Location: Part of the module permissions in the package I2CE 4.1-dev
- Source: Defined in the file modules/Permissions/lib/I2CE_PermissionParser.php on line 29
Variables
$user
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 31
- Type: protected $user
$template
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 32
- Type: protected $template
$has_get_data
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 33
- Type: protected $has_get_data
$has_get_display
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 34
- Type: protected $has_get_display
$task_trickle_down
A cached array of the task trickle down data.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 38
- Type: static protected array $task_trickle_down
$task_trickle_up
The reverse of the trickle down array.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 42
- Type: static protected array $task_trickle_up
$role_trickle_up
The role_trickle_up data cached for faster access.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 46
- Type: static protected array $role_trickle_up
$role_tasks
A list of tasks given by a role.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 50
- Type: static protected array $role_tasks
$role_has_task
A cache of tasks a role can access for repeated checkes.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 54
- Type: static protected array $role_has_task
Methods
__construct()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 57
- Signature: public function __construct($template)
- Parameters:
- $template
evaluateBooleans()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 830
- Signature: protected function evaluateBooleans($booleans)
- Parameters:
- $booleans
getRoleHasTask()
Return the permitted value from the role/task cache.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 117
- Signature: static protected function getRoleHasTask($role,$task)
- Parameters:
- Returns: boolean
getRoleTasks()
Return the array of tasks that are directly given by a role.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 136
- Signature: static protected function getRoleTasks($user_role)
- Parameters:
- string $user_role
- Returns: array
getRoleTrickleUp()
Returns the role trickle up from the shortname
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 385
- Signature: static protected function getRoleTrickleUp($name)
- Parameters:
- string $name
the role shortname
- string $name
- Returns: array
(an empty array if there is no such tag name)
hasPermission()
Check to see if a user has permission for a given role/task whatever @param string $permissions The permisisions string. Example: "role(admin) or task(can_view_page) or task(can_edit_page)" Example: "ModuleName->Method(admin) will call Method in the module ModuleName with arguemnts ('admin') Exmaple: "role(admin|staff)" is the same as "role(admin,staff)" which is the same as "role(admin) role(staff)" which is the same as "role(admin) | role(staff)" which is the same as "role(admin) or role(staff)" Example: "role(admin) or task(can_view_page) and role(staff)" is the same as "(role(admin) or task(can_view_page)) and role(staff)" i.e. parenthesis are grouped left. Note: You may reference variables, which is really template data, as a function argument or in a double quoted string. When referencing varaibles, you are allowed to include types, such as ${T1}z, but you are not allowed to do so in a doulbe quoted string. Variable names may consit of alpha-numeric character, '_', and '-'. You may protect a variable by surrounding it in {}'s Example: "func1($a,"x$a", '\' "' "x{$a}y" , "x{$ay} ${T1}z )" causes the (possbily fuzzy) method hasPermission_func1() with the following arguments: array( $this->template->getDisplayData('a',$node), 'x' . $this->template->getDisplayData('a',$node), '\' "', 'x' . $this->template->getDisplayData('ay',$node) , 'x' . $this->template->getDisplayData('a',$node) . 'y', 'x' . $this->template->getData('T1',z,$node,true,true)) There are special argument you can pass to the function which are <TEMPLATE>, <USER> and <NODE> which will be the template, user and calling node associated with this permission. Note: spaces provide an implicit comma to split arguments. Example functions: role, task which take a list or roles and task repsectively. Example function: form('person' method <USER>) -- finds the person form,relative to $node and calls $form->method($user) Example function: form(person , 'weird method;',<USER>10) -- finds the person form,relative to $node and calls $form->$method($user,10) where $method='weird method;' Example function: module('mod_name',method,arg1,...,argn) works like form but for modules
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 227
- Signature: public function hasPermission($permission,$node)
- Parameters:
- $permission
- DOMNode $node
The node to get on set data from.- Default Value: null
- Returns: mixed.
True/false, or null on failure.
hasPermission_role()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 397
- Signature: protected function hasPermission_role($node,$roles)
- Parameters:
- $node
- $roles
hasPermission_task()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 323
- Signature: protected function hasPermission_task($node,$tasks)
- Parameters:
- $node
- $tasks
hasPermission_user()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 448
- Signature: protected function hasPermission_user($node,$users)
- Parameters:
- $node
- $users
hasPermsssion_module()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 269
- Signature: protected function hasPermsssion_module($node,$args)
- Parameters:
- $node
- $args
hasRole()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 239
- Signature: public function hasRole($role,$node)
- Parameters:
- $role
- $node
- Default Value: null
hasTask()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 253
- Signature: public function hasTask($task,$node)
- Parameters:
- $task
- $node
- Default Value: null
parsePermissionsLogic()
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 487
- Signature: protected function parsePermissionsLogic($permission,$node)
- Parameters:
- &$permission
- $node
setRoleHasTask()
Add a task as permitted for a given role as well as all tasks it trickles down to recursively if the permission is allowed (true).
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 93
- Signature: static protected function setRoleHasTask($role,$task)
- Parameters:
setupTrickleDown()
Set up the trickle down static array if it hasn't been set.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 69
- Signature: static protected function setupTrickleDown($override)
- Parameters:
- boolean $override
Override what's there if true- Default Value: false
- boolean $override
taskExists()
Checks to see if the given task is defined in they system
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 293
- Signature: static public function taskExists($task)
- Parameters:
- string $task
- Returns: boolean
taskHasAlternateSatisfaction()
Checks to see if a given task has an alternative way of being satisfied.
- Defined in i2ce/modules/Permissions/lib/I2CE_PermissionParser.php on line 302
- Signature: protected function taskHasAlternateSatisfaction($node,$task)
- Parameters:
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()
Fuzzy Methods
hasPermission_userSatisfies()
This method is implemented by iHRIS_Module_SelfService->hasPermission_userSatisfies()
hasPermission_satisfies()
This method is implemented by I2CE_Module_FormRelationshipBasedPermissions->hasPermission_satisfies()
hasPermission_form()
This method is implemented by I2CE_Module_Forms->hasPermission_form()