Spatie permission not only for 'features' but also other dimensions like orders from manufacturer X #2459
-
Hey, We like to improve our ACL role based system. Currently we are allowing our users to have 'direct permissions', permissions directly assigned to the user. We don't want to do this anymore, and only allow role based permissions. The laravel-permission package is beautiful to accomplish this. It's perfect to get permissions right for features, like 'edit document', 'create task', etc. But for some of our models (like sales) we like the ability to have a role that will be able to access a part of the sales, namely the sales for the supplier of the sale. So that the supplier is able to login (with a 'supplier role'). That supplier won't be able to 'delete sales', etc. But the main difference with other roles is that this role will only be able to view sales that are associated (1 sale can only have 1 supplier) with the configured supplier(s) for that role. So next to a feature dimension, we'd also like to add a 'data' dimension for the permissions. I have checked the documentation, the only thing that I could find that's a bit the same is the team_id. Is that the right way to do this for the supplier dimension as well? And in the future I could imagine that we might have more of these dimensions, like manufacturer, etc. Could we also use this system to check if a user should have access to a particular sale? A user can only access a sale of which he is the owner or assignee. Thanks, Nick |
Beta Was this translation helpful? Give feedback.
#2426 (comment)