Manually check filters against a model class instance using a ViewSet?

14 views
Skip to first unread message

Logan Pulley

unread,
Aug 3, 2020, 1:32:34 PM8/3/20
to Django REST framework
Hi all,

I'm working on a Django Channels WebsocketConsumer and I'm trying to have it "imitate" a ViewSet; the class has an associated ViewSet class, and I want to be able to check individual model objects against that ViewSet's permissions and filters.

For example, say I have some ViewSet called `FooViewSet` with some queryset. I want to be able to (using just `FooViewSet`, a user, some filters `foo_filters`, and an object `some_foo`) determine if the user has permissions to access `some_foo` and whether `some_foo` passes the filters `foo_filters`.

Any ideas on how to accomplish this?
Reply all
Reply to author
Forward
0 new messages