How to get OR permissions instead of AND in REST framework

前端 未结 6 1420
遇见更好的自我
遇见更好的自我 2021-02-05 06:45

It seems that permission classes are ANDed when REST framework checks permissions. That is every permission class needs to return True for permission to be granted. This makes t

6条回答
  •  再見小時候
    2021-02-05 07:01

    Aside from the custom permission which is simpler approach mentioned in the earlier answer, you can also look for an existing 3rd party that handle a much complex permission handling if necessary.

    As of Feb 2016, those handling complex condition permission includes:

    • rest_condition
    • djangorestframework-composed-permissions

提交回复
热议问题