Toran Billups
unread,May 24, 2013, 3:21:47 PM5/24/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-res...@googlegroups.com
If I want to apply authentication across my entire api I can use the settings below globally
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'my.authentication_classes.SignedOrSessionAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'my.permission_classes.ForceAuthentication',
)
}
But when I need to support an api that has both authenticated and unauthenticated endpoints => can I override the permission and auth classes on a "per view" basis like so?
class FooCreateAPIView(generics.CreateAPIView):
permission_classes = (permissions.AllowAny, )
I tried to do this and had no such luck (using the base settings above + the custom override on the CBV you see above)
If I'm wrong, I must have missed something and would love to hear what I skipped in the above setup
If I'm right could someone confirm this is how the project works today? Also is this something the framework could support in the near future? mixed authentication for situations like this?
Thank you in advance
Toran