0

I want to hide or restrict access to a particular page from admin users. That means if an admin user tried to reach a page (e.g. System > Tools > Compilation ) he/she would see a 404 not found notice (like when you install an extension, before you log out and log back in).

I read some information about ACL in Magento, but I'm not sure if this is the place to start.

How can I do this? I'm developing an extension for this task.

UPDATE:

Sorry. I should have said that I'm writing an extension for this task and the extension should restrict access to both current users and future users.

  • 1
    instead of giving admin credentilas, dont you want to create new users and give credentials ? – Baby in Magento Jul 5 '17 at 6:50
  • System -> Permissions -> Roles set acl permission for particular user – Rama Chandran M Jul 5 '17 at 6:58
2

You can create New roles for those users in System > Permission > Roles

enter image description here

You can create new users in Magento Backend :

System > Permission > Users > Add New User and enter below details and Assign the User to Role :

enter image description here

you can check below links for more information :

http://docs.magento.com/m1/ce/user_guide/store-operations/permissions-user-new.html

https://www.simplehelix.com/blog/magento/14930/

https://www.hostknox.com/tutorials/magento/users-and-user-roles

0

You should create new roles with the correct permissions and add users for which you want to assign those privileges. Please refer to this excellent tutorial for more detailed info: http://alanstorm.com/magento_acl_authentication/

0

I managed to solve it. You should rewrite the corresponding controller class. For example if you want to restrict access to Notifications page, you should find its controller and rewrite its _isAllowed() method. Like this:

In config.xml:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Your_Module before="Mage_Adminhtml">Your_Module_Adminhtml</Your_Module>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Create app/code/local/Your/Module/controllers/Adminhtml/NotificationController.php:

require_once 'Mage/Adminhtml/controllers/NotificationController.php';
class Your_Theme_Adminhtml_NotificationController extends Mage_Adminhtml_NotificationController {
    protected function _isAllowed() {
        return false;
    }
}

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.