1

Query to get user permissions list in magento2

Admin roles role_type table column

I found related query in above link but permission column is missing . Permission column exists in authorization rule table. So I am stuck with joining the table . So please anyone tell me the query to retrieve all user permissions list from database.

0

1 Answer 1

0

There is multiple way to link table to another here i'm using inner join to link the table authorization_rule with authorization_role table https://www.w3schools.com/sql/sql_join_inner.asp

If you are looking to get the permissions throw db here is the query you need

SELECT arule.role_id, arole.role_name, arule.resource_id, arule.permission 
FROM authorization_rule as arule 
INNER JOIN authorization_role AS arole 
ON arule.role_id = arole.role_id 
where arole.role_id = <Enter the role id here>;

You can get and modify user permissions throw the BO of magento 2 on

System > Permissions > User Roles > select the role > tab Role Ressources

Way to get to role permissions : System > Permissions > User Roles, select the role > tab Role Ressources

If you need a way to get the permission list throw code let me know.

1
  • Okay thank you for the response . Definitely I will try this
    – sandhya S
    Commented Jun 30, 2023 at 9:58

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.