I have created a admin user by below command.

php bin/magento admin:user:create --admin-user="admin1" --admin-password="admin@123" --admin-email="admin1@gmail.com" --admin-firstname="fname" --admin-lastname="lname"

Now, Admin is login successfully but I do not have permission for anything in admin. Below is the Error.

Sorry, you need permissions to view this content. Please help me how can I solve this.


Check your module's acl.xml file for error & then do setup upgrade. If issue still persists then comment code in acl.xml file & then do setup upgrade. Hope this will help!

| improve this answer | |

this issue is related to admin created user access. it is occurs if user try to access unauthorised resources i suggest you to do the following two things

1) check your acl.xml file and provide access to the resource from backend using administrator credencials navigate to system>>user roles>>resources and checked the recource option

2) remove/comment the _isAllowed() method body from controller file. like below.

protected function _isAllowed()
    return $this->_authorization->isAllowed('Vendor_ModuleName::Resource');
| improve this answer | |

There are some other things that you can have to do to have access again.

As far as I know, if you do not have access to the back-office, you will not be able to change permission for the new user.

In that case, you will need to do plain sql modifications as explained in this post : Reset roles for Magento 2

If you have access with another user to the back-office, go to Magento documentation about admin users and follow instructions for the user with restricted access. It will unlock the permission for the other user.

| improve this answer | |
  • Thanks @Christophe I have try with your suggested URL(Reset roles for Magento 2) but it's not working for me. – user7064432 Dec 13 '18 at 8:56
  • Can you please provide me with the queries you've made ? Update your question for more clarity. – Christophe Ferreboeuf Dec 13 '18 at 9:39

If you have recently done your Magento setup and facing this issue,

Clear all the cache and generated folder. Please let me know if this works, thank you!

rm -rf var/* generated/*
| improve this answer | |

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.