Syntax:
Mage::getSingleton('admin/session')
->isAllowed('[resource_item1_path]/[resource_item1_child_path]')
Example:
$adminSession = Mage::getSingleton('admin/session');
// Checks the permission for managing of products
$adminSession->isAllowed('admin/catalog/products');
// Checks the permission for the order creation in Magento Admin
$adminSession->isAllowed('sales/order/create');
// Checks the permission for the order view in Magento Admin
$adminSession->isAllowed('sales/order/view'));
Reference:
Defining acl resources custom and admin menu
No comments:
Post a Comment