Policies of the shop module
The policy functions of shop and their limitations, from $FunctionList in kernel/shop/module.php. In the administration they are chosen under Roles and policies; a policy on shop/* grants every function.
administrate
Checked by the views: archivelist, archiveorder, customerlist, customerorderview, dashboard, orderlist, productsoverview, removeorder, statistics, unarchiveorder.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'shop', 'administrate' );if fetch( 'user', 'has_access_to', hash( 'module', 'shop', 'function', 'administrate' ) )
...
/ifbuy
Checked by the views: add, basket, checkout, confirmorder, orderview, preferredcurrency, register, setpreferredcurrency, setusercountry, updatebasket, userregister, wishlist.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'shop', 'buy' );if fetch( 'user', 'has_access_to', hash( 'module', 'shop', 'function', 'buy' ) )
...
/ifedit_status
Checked by the views: status.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'shop', 'edit_status' );if fetch( 'user', 'has_access_to', hash( 'module', 'shop', 'function', 'edit_status' ) )
...
/ifsetstatus
Checked by the views: setstatus.
| Limitation | Values come from |
|---|---|
| FromStatus | eZOrderStatus::fetchPolicyList() |
| ToStatus | eZOrderStatus::fetchPolicyList() |
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'shop', 'setstatus', array( 'FromStatus' => array( /* values */ ) ) );if fetch( 'user', 'has_access_to', hash( 'module', 'shop', 'function', 'setstatus' ) )
...
/ifsetup
Checked by the views: currencylist, discountgroup, discountgroupedit, discountgroupview, discountruleedit, editcurrency, editvatrule, productcategories, vatrules, vattype.
No limitations: the policy is all or nothing.
// Give a role the policy (eZRole::appendPolicy( $module, $function, $limitations ))
$role = eZRole::fetchByName( 'Editor' );
$role->appendPolicy( 'shop', 'setup' );if fetch( 'user', 'has_access_to', hash( 'module', 'shop', 'function', 'setup' ) )
...
/ifRelated
Generated by ./console exp:help:examples from kernel/shop/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.