Dedicated pages for specific group members

39 views
Skip to first unread message

Luca Brandi

unread,
Apr 7, 2016, 6:55:08 AM4/7/16
to Django users
Hi
is there a possibility to create some group members and let them have some secific url pages accessible to?
I am thinking to a kind of "if staff is member of group"....open link page..
Thanks

Larry Martell

unread,
Apr 7, 2016, 8:35:55 AM4/7/16
to django...@googlegroups.com

Luis Zárate

unread,
Apr 8, 2016, 7:52:04 AM4/8/16
to django...@googlegroups.com
Admin site is a great example of how to do that.  But in general you can use in the view

if not request.user.has_perm("app name.perm name):
         Raise error like 404 or redirect to login

I think decorator is provide by django.
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY5TeX8Tm-sCFzD89-aaQ6XK18V%2BSwS2W-2HbMCKjNyFLw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Reply all
Reply to author
Forward
0 new messages