mercredi 10 février 2021

How to implement dynamic creation of permission groups with different set of endpoints Django Rest Framework

In my project I have lot of endpoint views (APIViews, ViewSets). For all of them now I set permissions, some of them are default (e.g. AllowAny) and some are custom created:

permission_classes = (IsUserHaveSomePermission,)

Now I want to implement some flexible system, that will allow me to specify set of allowed endpoints for each user, for example:

On front-end I want to select some user and have a list of checkboxes that correspond to project's endpoints.

enter image description here

This is just an utopian solution, some details may be changed, but the main question is to how make something similar so that admins can basically dynamically change list of allowed endpoints/views for user? thanks in advance

Aucun commentaire:

Enregistrer un commentaire