drf-access-policy icon indicating copy to clipboard operation
drf-access-policy copied to clipboard

How to apply access policies to class based views

Open noemiefedon opened this issue 1 year ago • 2 comments

I would like to apply the class-based views, not to ViewSets or function-based views. For example I would like to use the access policies to Views derived from rest_framework.generics, such as RetrieveAPIView.

I managed to apply the access policy when using "action": ["*"] for the RetrieveAPIView view, but if I use "action": ["list", "retrieve", "get"] it does not work, so I don't know how to use finely-tuned access policies in this context.

Thanks in advance for your help :)

noemiefedon avatar Mar 28 '24 18:03 noemiefedon

I am also wondering this, does this library work for DRF Generic Views?

Edit: https://github.com/rsinger86/drf-access-policy/issues/37

ex8 avatar May 24 '24 19:05 ex8

I am also wondering why it doesn't work CBV?

muler2009 avatar Oct 05 '24 20:10 muler2009