Answer the question
In order to leave comments, you need to log in
Organization of roles and rights for the store?
Hello!
Need help!
there are:
1) user model User - id, first_name
2) store model Store - id, name
3) role model Role - id, name, code
4) rights model for roles Permission - id, name, code
one store can have multiple users with only one role per user
created a migration shops_users - shop_id, user_id, role_id
How do I list a user's shops with permissions for each shop?
And another question - how can I check the user's rights to an action in a particular store when performing some actions?
Answer the question
In order to leave comments, you need to log in
to begin with, the system of rights must be planned. determine how what and where will be checked. at what levels. at what points
and I’ll say it straight out - if you have a question “how to display a list of user stores with rights” - then it’s unlikely that you will be able to make a working non-leaky system of rights
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question