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
Override
app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php
and findprotected 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.
-
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.– YogitaCommented Aug 29, 2016 at 13:18
-
-
Yes, But if admin1 create user later than that users will show to admin2 because they are created later admin2– YogitaCommented Aug 29, 2016 at 13:32