Skip to content

Combining has_permission with has_object_permission isn't working #11

@ArtemBernatskyy

Description

@ArtemBernatskyy

Plz mention in docs that in order to achieve correct combining has_permission with has_object_permission
We need to both override both has_object_permission and has_permission

For example

class OperatorPermission(permissions.BasePermission):
    """
        Allowing access to Operator only
    """

    def has_permission(self, request, view):
        return request.user.is_operator

    def has_object_permission(self, request, view, obj):
        return request.user.is_operator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions