How do I reset administrator Role permissionsHow do I reset Magento Admin User RoleSorry, you need permissions to view this contentHow to Reset Magento Admin PermissionHow do I reset Magento Admin User RoleHow to get magento user phone number?Magento 2 - How to get admin user role?Remove delete customer option from a user roleAdmin role automatically unchecked when role is edited Magento 1.9How to reset admin permissions in database in Magento 2?Error on logging on admin: Sorry, you need permissions to view this contentCan i create Role for only read permissions of product in magento 2 admin panelRestrict the role permission to read onlyHow to Reset Magento Admin Permission

C++ copy constructor called at return

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

What kind of floor tile is this?

Why does this expression simplify as such?

How to get directions in deep space?

Can I turn my anal-retentiveness into a career?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

What is the difference between lands and mana?

Why is the Sun approximated as a black body at ~ 5800 K?

C++ check if statement can be evaluated constexpr

Multiplicative persistence

What (the heck) is a Super Worm Equinox Moon?

Biological Blimps: Propulsion

It grows, but water kills it

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

awk assign to multiple variables at once

How does electrical safety system work on ISS?

Did the UK lift the requirement for registering SIM cards?

A variation to the phrase "hanging over my shoulders"

Giving feedback to someone without sounding prejudiced

Is this part of the description of the Archfey warlock's Misty Escape feature redundant?

Has any country ever had 2 former presidents in jail simultaneously?

Does the Linux kernel need a file system to run?

Does "he squandered his car on drink" sound natural?



How do I reset administrator Role permissions


How do I reset Magento Admin User RoleSorry, you need permissions to view this contentHow to Reset Magento Admin PermissionHow do I reset Magento Admin User RoleHow to get magento user phone number?Magento 2 - How to get admin user role?Remove delete customer option from a user roleAdmin role automatically unchecked when role is edited Magento 1.9How to reset admin permissions in database in Magento 2?Error on logging on admin: Sorry, you need permissions to view this contentCan i create Role for only read permissions of product in magento 2 admin panelRestrict the role permission to read onlyHow to Reset Magento Admin Permission













3















If you have managed to loose your role permissions, like this: How do I reset Magento Admin User Role










share|improve this question
























  • I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

    – Cri
    yesterday












  • This is not an answer to the question. Please provide an answer or consider asking a new question.

    – HelgeB
    yesterday











  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

    – Shoaib Munir
    yesterday















3















If you have managed to loose your role permissions, like this: How do I reset Magento Admin User Role










share|improve this question
























  • I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

    – Cri
    yesterday












  • This is not an answer to the question. Please provide an answer or consider asking a new question.

    – HelgeB
    yesterday











  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

    – Shoaib Munir
    yesterday













3












3








3


1






If you have managed to loose your role permissions, like this: How do I reset Magento Admin User Role










share|improve this question
















If you have managed to loose your role permissions, like this: How do I reset Magento Admin User Role







magento2 admin user-roles






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:54









Community

1




1










asked Jul 6 '16 at 8:09









ArtogArtog

14615




14615












  • I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

    – Cri
    yesterday












  • This is not an answer to the question. Please provide an answer or consider asking a new question.

    – HelgeB
    yesterday











  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

    – Shoaib Munir
    yesterday

















  • I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

    – Cri
    yesterday












  • This is not an answer to the question. Please provide an answer or consider asking a new question.

    – HelgeB
    yesterday











  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

    – Shoaib Munir
    yesterday
















I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

– Cri
yesterday






I deleted the error, the admin role in Magento2 and can not log in. How do I restore?

– Cri
yesterday














This is not an answer to the question. Please provide an answer or consider asking a new question.

– HelgeB
yesterday





This is not an answer to the question. Please provide an answer or consider asking a new question.

– HelgeB
yesterday













If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

– Shoaib Munir
yesterday





If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

– Shoaib Munir
yesterday










1 Answer
1






active

oldest

votes


















3














Note:- Use mysqldump to back up your database before doing anything further, As it will change the database values and will not be recoverable.



Run this sql command to reset role with id 1 to all permissions:



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


Run this if you have deleted the Administrator group:



REPLACE 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')


Note the use of REPLACE, this will delete any existing. So be mindful of that.



Lastly you need to make sure your user have the correct role:



REPLACE INTO authorization_role 
(`role_id`, `parent_id`, `tree_level`, `sort_order`, `role_type`, `user_id`, `user_type`, `role_name`)
VALUES
(2, 1, 2, 0, 'U', <insert your user id here>, '2', <insert user name here>)


You can find your user id by running:



SELECT `user_id`, `username` FROM `admin_user`;





share|improve this answer
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124428%2fhow-do-i-reset-administrator-role-permissions%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Note:- Use mysqldump to back up your database before doing anything further, As it will change the database values and will not be recoverable.



    Run this sql command to reset role with id 1 to all permissions:



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


    Run this if you have deleted the Administrator group:



    REPLACE 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')


    Note the use of REPLACE, this will delete any existing. So be mindful of that.



    Lastly you need to make sure your user have the correct role:



    REPLACE INTO authorization_role 
    (`role_id`, `parent_id`, `tree_level`, `sort_order`, `role_type`, `user_id`, `user_type`, `role_name`)
    VALUES
    (2, 1, 2, 0, 'U', <insert your user id here>, '2', <insert user name here>)


    You can find your user id by running:



    SELECT `user_id`, `username` FROM `admin_user`;





    share|improve this answer





























      3














      Note:- Use mysqldump to back up your database before doing anything further, As it will change the database values and will not be recoverable.



      Run this sql command to reset role with id 1 to all permissions:



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


      Run this if you have deleted the Administrator group:



      REPLACE 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')


      Note the use of REPLACE, this will delete any existing. So be mindful of that.



      Lastly you need to make sure your user have the correct role:



      REPLACE INTO authorization_role 
      (`role_id`, `parent_id`, `tree_level`, `sort_order`, `role_type`, `user_id`, `user_type`, `role_name`)
      VALUES
      (2, 1, 2, 0, 'U', <insert your user id here>, '2', <insert user name here>)


      You can find your user id by running:



      SELECT `user_id`, `username` FROM `admin_user`;





      share|improve this answer



























        3












        3








        3







        Note:- Use mysqldump to back up your database before doing anything further, As it will change the database values and will not be recoverable.



        Run this sql command to reset role with id 1 to all permissions:



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


        Run this if you have deleted the Administrator group:



        REPLACE 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')


        Note the use of REPLACE, this will delete any existing. So be mindful of that.



        Lastly you need to make sure your user have the correct role:



        REPLACE INTO authorization_role 
        (`role_id`, `parent_id`, `tree_level`, `sort_order`, `role_type`, `user_id`, `user_type`, `role_name`)
        VALUES
        (2, 1, 2, 0, 'U', <insert your user id here>, '2', <insert user name here>)


        You can find your user id by running:



        SELECT `user_id`, `username` FROM `admin_user`;





        share|improve this answer















        Note:- Use mysqldump to back up your database before doing anything further, As it will change the database values and will not be recoverable.



        Run this sql command to reset role with id 1 to all permissions:



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


        Run this if you have deleted the Administrator group:



        REPLACE 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')


        Note the use of REPLACE, this will delete any existing. So be mindful of that.



        Lastly you need to make sure your user have the correct role:



        REPLACE INTO authorization_role 
        (`role_id`, `parent_id`, `tree_level`, `sort_order`, `role_type`, `user_id`, `user_type`, `role_name`)
        VALUES
        (2, 1, 2, 0, 'U', <insert your user id here>, '2', <insert user name here>)


        You can find your user id by running:



        SELECT `user_id`, `username` FROM `admin_user`;






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 19 '17 at 8:43









        Deepanshu Jain

        22218




        22218










        answered Jul 6 '16 at 8:09









        ArtogArtog

        14615




        14615



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124428%2fhow-do-i-reset-administrator-role-permissions%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Sum ergo cogito? 1 nng

            三茅街道4182Guuntc Dn precexpngmageondP