api.permissions

class api.permissions.CanRegenerateToken[source]

Checks if a user can regenerate a token

has_permission(request, view)[source]

Return True if permission is granted, False otherwise.

class api.permissions.HasBuilderAuth[source]

View permission to allow builder to perform actions with a special HTTP header

has_permission(request, view)[source]

Return True if permission is granted, False otherwise.

class api.permissions.HasRegistrationAuth[source]

Checks to see if registration is enabled

has_permission(request, view)[source]

If settings.REGISTRATION_MODE does not exist, such as during a test, return True Return True if permission is granted, False otherwise.

class api.permissions.IsAdmin[source]

View permission to allow only admins.

has_permission(request, view)[source]

Return True if permission is granted, False otherwise.

class api.permissions.IsAdminOrSafeMethod[source]

View permission to allow only admins to use unsafe methods including POST, PUT, DELETE.

This allows

has_permission(request, view)[source]

Return True if permission is granted, False otherwise.

class api.permissions.IsAnonymous[source]

View permission to allow anonymous users.

has_permission(request, view)[source]

Return True if permission is granted, False otherwise.

class api.permissions.IsAppUser[source]

Object-level permission to allow owners or collaborators to access an app-related model.

has_object_permission(request, view, obj)[source]
class api.permissions.IsOwner[source]

Object-level permission to allow only owners of an object to access it. Assumes the model instance has an owner attribute.

has_object_permission(request, view, obj)[source]
class api.permissions.IsOwnerOrAdmin[source]

Object-level permission to allow only owners of an object or administrators to access it. Assumes the model instance has an owner attribute.

has_object_permission(request, view, obj)[source]
api.permissions.is_app_user(request, obj)[source]