I have created new user from admin > permission > user .

Now I want to get current user permission role

 $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
 $role = Mage::getSingleton('customer/group')->load($roleId)->getData('customer_group_code');
 $role = strtolower($role);

but its now working

  • I tried that code snippet and it's working. What do you mean by 'not working'? – Laura Feb 18 '15 at 21:12

Not sure if I understand your question, but it seem as you created an "admin user" and not a "customer".

To get an admin user role try (assuming that user is log in)

$admin_user_session = Mage::getSingleton('admin/session');
$adminuserId = $admin_user_session->getUser()->getUserId();
$role_data = Mage::getModel('admin/user')->load($adminuserId)->getRole()->getData();

See Magento: How to get user role from user id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.