The use case here is a multi-tenant setup, where users can be members of multiple tenants, so their role may be different based on the different tenant.
EDIT: RELATED REQUEST: Also make the cookie domain of a security provider dynamic…or if that is not an option, target specific.
You could already do this by having a permissions table in the DB that maps the user ID to permissions profile(s) with a column identifying the tenant. You would then create a view that joins the user table to the profile which would be the basis of your permission step.
That being said, I do agree that it would be handy to have dynamic bindings available!
Similar but I think that using SC bindings makes more sense.
Right now we have a hard-coded permission system.
Implementing a database hardcoded approach would just extend a tiny bit the options. What if I want to store my permissions on a file? Or what if I want to implement a custom module that spits my permissions.
All in all, I think bindings(which cover DBs) make more sense and results in a more Wapplery way.
Cashbin sounds like a good option but would mean a custom module/API calls just to handle those ACL requests, eg role, and rights would need to be passed across separately.
As “Security Restrict” already handles the authentication part, it would be nice to have it handle the dynamic permissions as well.
And for Frontend restrictions we could have them passed down in the cookies so we can restrict certain elements based on permissions.
@George@patrick, We have already hit more than 20 votes on this, Any chances of having this feature in future updates?
Dynamic Permissions.zip (5.9 KB)
Sharing the files that I had to change for this functionality. @patrick, Could you please have a look at it, we could also have a checkbox for dynamic or regular and conditional clause OR/AND, this would be of great help.
@Roney_Dsilva that looks impressive… do you think it could be made as an addon module? Not sure how to implement your functionality and i’m pretty sure any update overwrites these files?