permissions#
DummyView#
Helper 'View' class to allow checking permissions for a specific object.
DatasetAccessPolicy permission checks require a view that has "action" and "get_object" attributes.
Source code in src/apps/common/permissions.py
DummyRequest#
Helper 'Request' class to allow checking permissions for a specific object.
AccessPolicy permission checks require a request that has "user" and "method" attributes.
Source code in src/apps/common/permissions.py
BaseAccessPolicy#
Bases: AccessPolicy
Common base access policy class.
For built-in special values that can be used in statements, see: https://rsinger86.github.io/drf-access-policy/statement_elements/
For permissions of operations that don't directly map to a view action, use custom
naming that won't clash with any potential action names, e.g. action="
Source code in src/apps/common/permissions.py
query_object_permission(user, object, action, method='')
#
Helper method for querying for permissions of an object for current user.
Normally has_permissions does not allow specifying object, action, or method directly. This function uses fake view and request objects to check for permissions without having to make an actual request.