[% IF UserInGroup('advanced') %] doesn't seem to work ...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[% IF UserInGroup('advanced') %] doesn't seem to work ...

Kiffin Gish-2
I have defined a new group called 'advanced', and in order to only let
the so-called advanced users view certain fields, I have enclosed the
code in the templates as follows:

[% IF UserInGroup('advanced') %]
   <tr>
     [% sel = { description => 'Platform', name => 'rep_platform' } %]
     [% INCLUDE select %]
   </tr>

   <tr>
     [% sel = { description => 'OS', name => 'op_sys' } %]
     [% INCLUDE select %]
   </tr>
[% END %]

However, this does not seem to work, as the code enclosed within the
IF-statement is always shown, whether or not the advanced checkbox is
enabled for the given user.

What am I doing wrong?

--
Kiffin Gish
Development Team, Demon (THUS plc)

Postbus 15829
1001 NH Amsterdam
The Netherlands

T: +31 (0)20-422 20 00
F: +31 (0)20-422 20 01
M: +31 (0)6-21 83 68 28
http://www.demon.nl
_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools
Reply | Threaded
Open this post in threaded view
|

Re: [% IF UserInGroup('advanced') %] doesn't seem to work ...

Dave Miller
Kiffin Gish wrote:

> I have defined a new group called 'advanced', and in order to only let
> the so-called advanced users view certain fields, I have enclosed the
> code in the templates as follows:
>
> [% IF UserInGroup('advanced') %]
>   <tr>
>     [% sel = { description => 'Platform', name => 'rep_platform' } %]
>     [% INCLUDE select %]
>   </tr>
>
>   <tr>
>     [% sel = { description => 'OS', name => 'op_sys' } %]
>     [% INCLUDE select %]
>   </tr>
> [% END %]
>
> However, this does not seem to work, as the code enclosed within the
> IF-statement is always shown, whether or not the advanced checkbox is
> enabled for the given user.
>
> What am I doing wrong?

The answer to that depends a lot on what version of Bugzilla you're
running.  If it's a more-recent version (such as 2.19.x or a 2.20rc) try
"user.groups.advanced" instead of "UserInGroup('advanced')".

--
Dave Miller                                   http://www.justdave.net/
System Administrator, Mozilla Foundation       http://www.mozilla.org/
Project Leader, Bugzilla Bug Tracking System  http://www.bugzilla.org/
_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools