3

I went into Admin->System->Permission->Roles & edit the role for Admin

Now, i am unable to re-set back it to original "ALL" permissions.

How can i revert back to original settings ?

Thanks

2 Answers 2

3

Whatever you do, do not delete the Magento stock Admin User account, much irritation ensues. As you're finding, messing with its Role ACL also has future repercussions.

The usual method is to use a script to create a new admin account with full access so you can repair the old account and reset the ACL to All.

I don't plan on plagiarizing work done by Inchoo, so this will be a linked answer: Locked out from Magento Admin

Reported to work with up to 1.8.1.0

Use mysqldump to back up your database before doing anything further.

2

[ Magento 2.x.x ]

Yes I also done this When I make First time in Module acl.xml and I was check it whether it works or not.

I try to create a Admin user one, two , three.... and no Admin user access, because I remove All Administrators's Role.

then I done Below thing to get All Admin user's Role ( Reset Role ).

Note:- use mysqldump to back up your databases before doing anything further

Step-1: Back up below Tables

    Table 1 :-  admin_user
    
    Table 2 :-  authorization_role
    
    Table 3 :-  authorization_rule
    

Step-2: truncate Above three Table using truncate command ( not using DELETE command )

truncate table [ Table Name ];

Step-3: insert new User in with All Roles , Run below three Command

  1. This insert data into admin_user table

         INSERT INTO `admin_user` (`user_id`, `firstname`, `lastname`, `email`, `username`, `password`, `created`, `modified`, `logdate`, `lognum`, `reload_acl_flag`, `is_active`, `extra`, `rp_token`, `rp_token_created_at`, `interface_locale`, `failures_num`, `first_failure`, `lock_expires`, `refresh_token`) VALUES (1, 'admin', 'admin', '[email protected]', 'admin', '45cf9053530ceb9fde49794d9e6d81fd2ce481b0136067986a5c9bc139a7d08f:FivE4hOQqPtW1xdE:2', '2019-07-23 10:48:31', '2019-09-09 13:20:42', '2019-09-09 13:20:42', 46, 0, 1, '{\"configState\":{\"contact_contact\":\"1\",\"web_default_layouts\":\"0\",\"web_default\":\"1\",\"web_secure\":\"1\",\"web_seo\":\"1\",\"web_unsecure\":\"1\",\"wishlist_wishlist_link\":\"1\",\"wishlist_email\":\"1\",\"wishlist_general\":\"1\",\"admin_emails\":\"0\",\"admin_startup\":\"0\",\"dev_front_end_development_workflow\":\"1\",\"dev_restrict\":\"0\",\"dev_debug\":\"1\",\"dev_template\":\"0\",\"sw_megamenu_general\":\"1\",\"newsletter_general\":\"1\",\"newsletter_subscription\":\"1\",\"dev_js\":\"0\",\"admin_security\":\"0\",\"admin_url\":\"0\",\"admin_dashboard\":\"0\",\"admin_captcha\":\"0\",\"sw_megamenu_custom_links\":\"1\",\"sw_megamenu_cat_labels\":\"1\",\"cms_wysiwyg\":\"1\",\"catalog_frontend\":\"1\",\"catalog_fields_masks\":\"0\",\"catalog_review\":\"1\",\"catalog_productalert\":\"1\",\"catalog_productalert_cron\":\"1\",\"catalog_placeholder\":\"1\",\"catalog_recently_products\":\"1\",\"catalog_product_video\":\"0\",\"catalog_price\":\"0\",\"catalog_layered_navigation\":\"1\",\"catalog_search\":\"0\",\"catalog_seo\":\"0\",\"catalog_navigation\":\"1\",\"catalog_downloadable\":\"1\",\"catalog_custom_options\":\"0\",\"layered_navigation_module\":\"1\",\"layered_navigation_general\":\"1\",\"carriers_flatrate\":\"1\",\"carriers_freeshipping\":\"1\",\"carriers_tablerate\":\"1\",\"carriers_temando\":\"1\",\"carriers_ups\":\"1\",\"carriers_usps\":\"1\",\"carriers_fedex\":\"1\",\"carriers_dhl\":\"1\",\"shipping_origin\":\"1\",\"shipping_shipping_policy\":\"1\",\"tax_vertex_settings\":\"1\",\"tax_classes\":\"1\",\"tax_calculation\":\"1\",\"tax_defaults\":\"1\",\"tax_display\":\"1\",\"tax_cart_display\":\"1\",\"tax_sales_display\":\"1\",\"tax_weee\":\"1\",\"tax_vertex_seller_info\":\"0\",\"tax_vertex_delivery_terms\":\"0\",\"tax_avaiable_shipping_product_codes\":\"0\",\"tax_vertex_logging\":\"0\",\"dev_grid\":\"0\",\"dev_static\":\"0\",\"dev_image\":\"0\",\"dev_css\":\"0\",\"dev_translate_inline\":\"0\",\"general_store_information\":\"1\",\"general_single_store_mode\":\"1\",\"general_locale\":\"1\",\"general_region\":\"1\",\"general_country\":\"1\",\"productinquiry_general_option\":\"1\",\"productinquiry_google_captcha\":\"1\",\"productinquiry_email_setting\":\"1\",\"trans_email_ident_general\":\"1\",\"product_attachment_general\":\"1\",\"product_attachment_display_configuration\":\"1\"}}', NULL, NULL, 'en_US', 0, NULL, NULL, NULL);
    
  2. This insert Data into authorization_role table

    INSERT INTO authorization_role (role_id, parent_id, tree_level, sort_order, role_type, user_id, user_type, role_name) VALUES (1, 0, 1, 1, 'G', 0, '2', 'Administrators'), (2, 1, 2, 0, 'U', 1, '2', 'admin');

  3. This insert Data into authorization_rule

    INSERT INTO authorization_rule (rule_id, role_id, resource_id, privileges, permission) VALUES (1, 1, 'Magento_Backend::all', NULL, 'allow');

Step-4: Run below Magento Command

    php bin/magento set:up;
    
    php bin/magento s:s:d -f ;
    
    php bin/magento c:f ;
    
    php bin/magento c:c ;
    

Step-5: Run your Admin login and try below username and password to login.

    username :- admin
    
    Password :- admin@123

if above username and password not working please create new admin user click here

Now your Administrators Role are Reset to default.

I Hope This Helps You.

3
  • if you have any doubt to above process related you can comment here
    – Msquare
    Sep 21, 2019 at 9:59
  • and next time you have to create another user role which have same as a admin role but not a exactly same to same role for next time this problem not create
    – Msquare
    Sep 21, 2019 at 10:14
  • You saved me a lot of time, and I just wanted to say Thank You <3 Mar 8, 2021 at 8:13

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.