Magento - How to query admin's role name?
问题 I am trying to get the name of the role of the currently logged in admin. I can get the admin user, but I can't figure out how to query their role name. The Magento docs are weak =/ $usr = Mage::getSingleton('admin/session')->getUser(); Ideas anyone? 回答1: Spoke too soon... I got the role name as follows: $roleId = implode('', Mage::getSingleton('admin/session')->getUser()->getRoles()); $roleName = Mage::getModel('admin/roles')->load($roleId)->getRoleName(); 回答2: Using this code you will get