Skip to content

has_object_permission doesn't get called #12

@alexseitsinger

Description

@alexseitsinger

In my viewset I have the following:
permission_classes = [ Or(And(IsReadOnlyRequest, IsAuthenticated), And(IsPutRequest, IsObjectUser)) ]

Where IsObjectUser has:
def has_object_permission(self, request, view, obj): return obj.user == request.user

The has_object_permission method is never invoked when wrapped inside the conditional statement. However, If I use the IsObjectUser as a plain permission class in permission_classes list, it works fine. This isn't suitable for me because I need them for each method, not for the whole viewset, always.

If this is bug, I would love to see it fixed. Any suggestions or workarounds are appreciated.

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