User Groups - Version 2.17.6

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

User Groups - Version 2.17.6

Joe-10
Hi,
I am trying to do a small mod where a certain group can delete static
Searches while all other users cannot.

I have implented the static search part of the code correctly, but am
having difficulty with checking if the user belongs to this group (in
2.17.6)

I am trying to use the following if statement:

if (Bugzilla->user->groups("staticSearch"))
{
    # do x
}
else
{
    # do y
}

The problem being that always y is always executed.  I cannot
understand why....

any help?

_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools
Reply | Threaded
Open this post in threaded view
|

Re: User Groups - Version 2.17.6

Joel Peshkin
Joe wrote:

>
> if (Bugzilla->user->groups("staticSearch"))
> {
>     # do x
> }
> else
> {
>     # do y
> }
>
> The problem being that always y is always executed.  I cannot
> understand why....

Because user->groups returns a hashref rather than querying based on an
argument.  You have to use $user->groups->{"staticsearch"}
_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools