Hi,
Say I have a function as follows:

def is_supervisor(user):
    return user.groups.filter(name='supervisor').exists()

...and a CBV for deleting records:

class DeleteFlow(DeleteView):
    # etc...

How can I restrict access to this view using the function?
I understand that this may be possible with a mixin, but how?
Or is there a better way?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cef271fb-b6e9-4e86-88d6-0bad8a90b0bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to