Question

I am developing a Store in Magento 2. I created an Admin Account at the time of installation of Magento 2. Later I tried to create another User (Who can only add product in the store) from Admin Panel and a User Role (Which has only product entry access). In this time I assigned Admin User to that specific role (Product entry).

Then I install a Magento 2 in local host and replaced all the data of admin_user , authorization_role, authorization_rule table of database to regain access of Admin User. But when I tried to login using that Admin User I am getting a Message You need more permissions to access this. I attached a screenshot below. How can I get previous Admin User with previous Access?

enter image description here

Était-ce utile?

La solution

The fastet option you have is to create a new admin and reset the previous user's permissions.

You can do it from command line.

Move to your Magento's root and type:

php bin/magento admin:user:create \
    --admin-user="mynewuser" \
    --admin-password="mynewpassword" \
    --admin-email="john@doe.com" \
    --admin-firstname="MyName" \
    --admin-lastname="MyLastName" 

This will create a new admin user with username mynewuser and password mynewpassword.

When you are in just fix your old admin user.

Autres conseils

If you want to preserve the existing user name "admin" setting the following columns in admin_user table solves the issue for me,

Columns:

Failure Number - 0 first_failure - NULL lock_expires - NULL

PHP MyAdmin:

Using PHP MyAdmin

I had the same issue. It was because the users were not assigned any roles. So I created roles and assigned it to the users.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top