I was creating user roles & permission as an admin in Magento 2, then I mistakenly denied myself permission to add roles and permission. Now It's showing "Access denied". I can't add or change my roles, and I know this is not an error or bug but a silly mistake from me. Please, how can go about that?

1 Answer 1


Please create new admin user by command line and then assign role to existing user.

$ bin/magento admin:user:create --admin-user="newadmin" --admin-password="yourpassword" --admin-email="[email protected]" --admin-firstname="newAdmin" --admin-lastname="newAdmin"
  • thank you for the response, do I have to assign the role using command line too?
    – Aasim Yaz
    Commented Jun 20, 2018 at 13:30

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.