vintasoftware / django-role-permissions

A django app for role based permissions.
http://django-role-permissions.readthedocs.org/
MIT License
730 stars 115 forks source link

Can role classes be created dynamically? #128

Closed anmolbk closed 3 years ago

anmolbk commented 3 years ago

To enable users to create arbitrary roles as they require, I think the role classes need to be created dynamically. Will adding the dynamically created role classes to "roles" module work? I guess not, as the role classes seem to be loaded on startup. Any possibility to reload roles (& permissions) every time a new role class (or permission) is created?

filipeximenes commented 3 years ago

The lib was not designed to work with dynamic roles. You can probably hack some solution but there's a risk you have compatibility problems so I wouldn't recommend