Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodrigowebjump/02c9e0f40e268f5fa537 to your computer and use it in GitHub Desktop.
Save rodrigowebjump/02c9e0f40e268f5fa537 to your computer and use it in GitHub Desktop.
Magento (ACL) Reset Admin user, role and resources permission to all
http://magentopaper.blogspot.com.br/2013/05/how-to-reset-magento-admin-user-role.html
How to reset magento Admin user, role and resources permission to all?
scenario 1: All resource permissions were set to none for the admin role
Solution:
Step 1: Get current admin role details
view plainprint?
SELECT * FROM admin_role WHERE role_name = 'Administrators'
/*Administrators - is Your admin role name*/
Step 2: Remove Existing permissions for the Admin role
view plainprint?
/*clean all permission rules*/
DELETE admin_rule
FROM admin_rule, admin_role
WHERE
admin_role.role_name = 'Administrators' /* Your admin role name*/
AND admin_rule.role_id = admin_role.role_id
Step 3: Update Permission rule for the admin role
view plainprint?
INSERT INTO admin_rule (role_id, resource_id, assert_id, role_type, permission)
VALUES ('1','all', '0', 'G', 'allow')
scenario 2: Admin was assignd to a wron role
Solution:
Step 1: Load your user information
view plainprint?
SELECT ar.*, au.*
FROM admin_user AS au
INNER JOIN admin_role AS ar ON (au.user_id = ar.user_id)
WHERE au.username = 'username'
Step 2: Load Role information
view plainprint?
SELECT * FROM admin_role WHERE role_type = 'G'
Step 3:Update your user for the proper role
view plainprint?
UPDATE admin_role SET parent_id = [put selected role_id here] WHERE user_id = [your USER id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment