0

I have an admin user and create one more that have all rights as admin user with one restriction that this new user can not see the admin user created before itself. So the New user can add/edit users create after him but not the one which is created before it.

1 Answer 1

0
  • Override app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php and find protected function _prepareCollection() function.

  • Add

    $createdDate = Mage::getModel('admin/user')->load(Mage::getSingleton('admin/session')->getUser()->getUserId())->getCreated();

    $collection = Mage::getResourceModel('admin/user_collection')->addFieldToFilter('created',array('gt' => $createdDate));

before $this->setCollection($collection);

  • Save the file and check.

Please let me know if you find any problem.

3
  • Thanks. But I Need Some More Functionality like I have 4 roles admin1, emp1, admin2,emp2, Admin1 can see all the users, Admin2 can see only user having role id for Admin2 and Emp2.
    – Yogita
    Commented Aug 29, 2016 at 13:18
  • Have you tried this solution? Commented Aug 29, 2016 at 13:31
  • Yes, But if admin1 create user later than that users will show to admin2 because they are created later admin2
    – Yogita
    Commented Aug 29, 2016 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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