Commit af96fe05 by Tom Christie

Add AllowAny class

parent d995742a
...@@ -18,6 +18,17 @@ class BasePermission(object): ...@@ -18,6 +18,17 @@ class BasePermission(object):
raise NotImplementedError(".has_permission() must be overridden.") raise NotImplementedError(".has_permission() must be overridden.")
class AllowAny(BasePermission):
"""
Allow any access.
This isn't strictly required, since you could use an empty
permission_classes list, but it's useful because it makes the intention
more explicit.
"""
def has_permission(self, request, view, obj=None):
return True
class IsAuthenticated(BasePermission): class IsAuthenticated(BasePermission):
""" """
Allows access only to authenticated users. Allows access only to authenticated users.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment