List Info

Thread: Re: Check if user is a member of group in template




Re: Check if user is a member of group in template
country flaguser name
United States
2007-10-10 01:57:56
Great. Now it works how I expected.

See also http://www.djangoproje
ct.com/documentation/templates_python/#extending-the-templat
e-system
for further information.


On 9 Okt., 21:38, Ryan  Kanno <ryanka...gmail.com> wrote:
> I think you're looking for something like this:
>
> http://ww
w.djangosnippets.org/snippets/282/
>
> On Oct 9, 3:22 am, äL <gri...gmx.ch> wrote:
>
> > Inhttp://code.djangoproject.com/wiki/CookBookRequire
dGroupLoginI
> > found how
> > to show a template only if the user is in a
specific group (admin).
>
> > Now I would like to do the same in a template. How
can I hide a link,
> > for example,
> > if the user is not in the admin group? I'm looking
for something like
> > this:
>
> > {% ifequal user.group "admin" %}
> > <a href="detail">Show
detail</a>
> > {% else %}
> > &nbsp;
> > {% endifequal %}
>
> > Is there a django-command to achive this aim?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )