Django role based views?

后端 未结 9 2019
既然无缘
既然无缘 2020-12-04 06:43

I\'m looking for some input on how others would architect this. I\'m going to provide class (django group) based views.

For example, a user\'s group will determine

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 07:31

    If you don't need real per-object ACLs, then you can just use the Django permission system. To get a list of all available permissions:

    from django.contrib.auth.models import Permission
    perms = Permission.objects.all()
    

    There is an API for other authentication and authorization sources, so you do not need to stick with this permissions table.

    You may hack this Django system to fit your needs in terms of this authorization model (RBAC) or you may come up with an ACL-like solution.

提交回复
热议问题