2

When you log into the Magento admin dashboard it shows the lifetime sales. We want to restrict that block to only show for the admin not for the other employees.

Of course, we could just remove the dashboard from their role, but we would like them to be able to access the dashboard, we just don't want them seeing the lifetime sales.

0

You can edit

\app\design\adminhtml\default\default\template\dashboard\totalbar.phtml

after the line

<?php foreach( $this->getTotals() as $_total ): ?>

simply check if the current total is lifetime and if the current logged in user is admin.

  • That's only half the answer because I want that particular resource to show up in the role resources so that I can decide what roles get to see it and what roles don't. – Haim Dec 4 '15 at 15:35
  • Well that's not too different. In that case just create the corresponding ACL settings. Alan Storm has a great tutorial on it, check the section titled "Adding an ACL role". Then just use this code to check if the current session user has your role: $session = Mage::getSingleton('admin/session'); $id = $session->getUser()->getUserId(); $role = Mage::getModel('admin/user')->load($id)->getRole()->getData(); – stukev Dec 4 '15 at 16:30

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.