Skip to content

Permissions

hypha.apply.api.v1.determination.permissions

HasDeterminationCreatePermission

Bases: BasePermission

Custom permission that user should have for creating determination.

has_permission

has_permission(request, view)
Source code in hypha/apply/api/v1/determination/permissions.py
def has_permission(self, request, view):
    try:
        submission = view.get_submission_object()
    except KeyError:
        return True
    return can_create_determination(request.user, submission)

HasDeterminationDraftPermission

Bases: BasePermission

Custom permission that user should have for editing determination.

has_object_permission

has_object_permission(request, view, obj)
Source code in hypha/apply/api/v1/determination/permissions.py
def has_object_permission(self, request, view, obj):
    submission = view.get_submission_object()
    return can_edit_determination(request.user, obj, submission)