Policies of the state module
The policy functions of state and their limitations, from $FunctionList in kernel/state/module.php. In the administration they are chosen under Roles and policies; a policy on state/* grants every function.
Some functions also take one limitation per object state group of the site, named StateGroup_<group identifier> (eZContentObjectStateGroup::limitations(), read from the database, so not listed below).
administrate
Checked by the views: edit, group, group_edit, groups, view.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'state', 'administrate' );if fetch( 'user', 'has_access_to', hash( 'module', 'state', 'function', 'administrate' ) )
...
/ifassign
Checked by the views: assign.
| Limitation | Values come from |
|---|---|
| Class | eZContentClass::fetchList() |
| Group | fixed: Self (1) |
| NewState | eZContentObjectState::limitationList() |
| Node | |
| Owner | fixed: Self (1) |
| Section | eZSection::fetchList() |
| Subtree |
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'state', 'assign', array( 'Class' => array( /* values */ ) ) );if fetch( 'user', 'has_access_to', hash( 'module', 'state', 'function', 'assign' ) )
...
/ifRelated
Generated by ./console exp:help:examples from kernel/state/module.php, kernel/classes/ezrole.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.