Permissions#

Contains classes that manage user permissions.

class fma_django_api.v1.permissions.IsActive#

Bases: BasePermission

Global permission for non client, active users for rest framework API.

has_permission(request, view)#

Checks whether or not the user’s request has permission.

Parameters:
  • request (Any) – The message recieved from the user

  • view (viewsets.ModelViewSet) – The viewset that the user is attempting to access

Returns:

A boolean to indicate if the user has permission

Return type:

bool

has_object_permission(request, view, obj)#

Return True if permission is granted, False otherwise.

class fma_django_api.v1.permissions.IsClientDeveloperAdmin#

Bases: BasePermission

Global permission for client, active users for rest framework API.

has_permission(request, view)#

Checks whether or not the user has permission.

Parameters:
  • request (Any) – The message recieved from the user

  • view (viewsets.ModelViewSet) – The viewset that the user is attempting to access

Returns:

A boolean to indicate if the user has permission

Return type:

bool

has_object_permission(request, view, obj)#

Return True if permission is granted, False otherwise.

class fma_django_api.v1.permissions.ClientCreateGetViewPermission#

Bases: BasePermission

Global permission for a client to interact with the experiments within FMA.

has_permission(request, view)#

Checks whether or not the user has permission.

Parameters:
  • request (Any) – The message recieved from the user

  • view (viewsets.ModelViewSet) – The viewset that the user is attempting to access

Returns:

A boolean to indicate if the user has permission

Return type:

bool

has_object_permission(request, view, obj)#

Return True if permission is granted, False otherwise.

class fma_django_api.v1.permissions.ClientViewOnlyPermission#

Bases: BasePermission

Global permission for a client to view experiment data within FMA.

has_permission(request, view)#

Checks whether or not the user has permission.

Parameters:
  • request (Any) – The message recieved from the user

  • view (viewsets.ModelViewSet) – The viewset that the user is attempting to access

Returns:

A boolean to indicate if the user has permission

Return type:

bool

has_object_permission(request, view, obj)#

Return True if permission is granted, False otherwise.

class fma_django_api.v1.permissions.RegisteredClientOnlyPermission#

Bases: BasePermission

Global permission for a registered client to have access.

has_object_permission(request, view, obj)#

Checks whether or not the user has permission.

Parameters:
  • request (Any) – The message recieved from the user

  • view (viewsets.ModelViewSet) – The viewset that the user is attempting to access

  • obj (viewsets.ModelViewSet) – The federated model object the user is registered with

Returns:

A boolean to indicate if the user has permission

Return type:

bool

has_permission(request, view)#

Return True if permission is granted, False otherwise.