Extend Security Provider with Permissions from Database

Thank you @Hyperbytes for posting the video, as I was just working on this scenario where any user can have multiple permission levels.

Next question on the same topic would be how to implement it with a many-to-many relationship.

As explained in your video, the permissions are forced into the db via a drop-down list. If I want to add a new permission level, I’d need to modify the html code within the page.

Maybe, a clearer separation between model and view would be achieved by having:

  • the users listed in a table tb_users
  • the permissions listed in a table tb_permissions
  • the relationship between the two represented as a many-to-many table between tb_users and tb_permissions

This way, adding a new type of permission would be achieved by updating the db, not working on the html code.

However, it seems to me that such a case cannot be realized by current implementation of Wappler Security Provider.

Any idea? Suggestion? Tks.

The problem is that the query generated acts upon the security provider so the permission name MUST be defined within the security provider to work so trying to define a new permission type outside the security provider definition will not be possible.

I would be nice to be able to be able to “inject” a new permission via a query but that would require code changes to the security provider and I don’t know if that would be feasible .
You need to ask @George about that one.

1 Like

Made a feature request about this one

3 Likes

Removed my vote because Dynamic Bindings make more sense as it allows more flexibility.