I know I'm a little late to the party here, but the documentation in this regard isn't exactly clear. From the current docs:
Provided they inherit from rest_framework.permissions.BasePermission, > permissions can be composed using standard Python bitwise operators So far I haven't been able to get this to work either, despite both my permissions inheriting from BasePermission. On Thursday, July 20, 2017 at 1:56:55 AM UTC-6, Xavier Ordoquy wrote: > > Hi, > > You’ll need to implement an intermediate permission classe that would > perform the OR and delegate the permission check to the subclasses. > > Regards, > Xavier Ordoquy, > Linovia. > > Le 19 juil. 2017 à 19:29, William Huang <[email protected] <javascript:>> > a écrit : > > Hi All, > > Is it possible to set permission_classes for OR relation ? > for example I want to allow a logged in user or an admin user to this > view, so I set: > > permission_classes = (IsAuthenticated, IsAdminUser) > > Is this correct? > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "Django REST framework" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
