Permission classes for Class Based Views

192 views
Skip to first unread message

piotr.sz...@pyquest.space

unread,
Mar 16, 2017, 6:05:49 PM3/16/17
to Django developers (Contributions to Django itself)
Hello, my first post here!

This post is about a new feature request I'd like to propose and it's about permission classes (just like I've stated in topic) for CBVs. I've provided most of the technical information at [0], because I think that such information is more ticket-specific, however I'm not sure if what I did is a correct way, because docs say that feature requests should begin their lifespan at the mailing list. Well, anyway basically saying the reason to have it in core Django is to make managing "who can do what" in a simpler, faster and more expendable manner.

I believe that everything that we need to discuss the matter is already at [0] so I'd be extremely happy if somebody would reply with some thoughts about it.

[0] https://code.djangoproject.com/ticket/27950

Marc Tamlyn

unread,
Mar 16, 2017, 6:10:44 PM3/16/17
to django-d...@googlegroups.com
I don't feel there is any need for this feature in Django. As you mention in the ticket, there are ways of approaching it used in DRF, there are other ways in django-braces[0], I personally have my own taste in how to handle it. The details will depend on the logic necessary - sometimes you need to load objects to check permission, sometimes you don't. There is no one size fits all approach.


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/605eddf3-147a-4e39-a9fb-4e40f055c4d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paweł Święcki

unread,
Mar 20, 2017, 7:25:02 AM3/20/17
to Django developers (Contributions to Django itself)
Good idea. I use permission classes in DRF and I would use them in Django. Using `|` for "or" is something to be discussed, though.
Reply all
Reply to author
Forward
0 new messages