views:

202

answers:

1

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  A: 

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();
1nsane