Policies of the user module
The policy functions of user and their limitations, from $FunctionList in kernel/user/module.php. In the administration they are chosen under Roles and policies; a policy on user/* grants every function.
activation
Checked by the views: unactivated.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'activation' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'activation' ) )
...
/ifaudit
Checked by the views: audit.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'audit' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'audit' ) )
...
/ifdeactivate
Checked by the views: deactivate.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'deactivate' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'deactivate' ) )
...
/ifhygiene
Checked by the views: hygiene.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'hygiene' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'hygiene' ) )
...
/iflogin
Checked by the views: activate, edit, login, logout, megamenu, passkeys, preferences, registration, security, sessions.
| Limitation | Values come from |
|---|---|
| SiteAccess | eZSiteAccess::siteAccessList() |
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'login', array( 'SiteAccess' => array( /* values */ ) ) );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'login' ) )
...
/ifpasskeys_manage
No view of the module names it; code checks it (eZUser::hasAccessTo( 'user', 'passkeys_manage' ) or the user/has_access_to fetch).
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'passkeys_manage' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'passkeys_manage' ) )
...
/ifpassword
Checked by the views: forgotpassword, password.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'password' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'password' ) )
...
/ifpreferences
Checked by the views: setting.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'preferences' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'preferences' ) )
...
/ifregister
Checked by the views: register, success.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'register' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'register' ) )
...
/ifselfedit
No view of the module names it; code checks it (eZUser::hasAccessTo( 'user', 'selfedit' ) or the user/has_access_to fetch).
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'selfedit' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'selfedit' ) )
...
/ifsessions
No view of the module names it; code checks it (eZUser::hasAccessTo( 'user', 'sessions' ) or the user/has_access_to fetch).
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'sessions' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'sessions' ) )
...
/ifsessions_manage
Checked by the views: sessionreport.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'user', 'sessions_manage' );if fetch( 'user', 'has_access_to', hash( 'module', 'user', 'function', 'sessions_manage' ) )
...
/ifRelated
Generated by ./console exp:help:examples from kernel/user/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.