Hi Dirk, thank you, your code works. Almost. ;) I had to mix it up a little bit with what I've found at the wiki (http://wiki.bestpractical.com/view/TestGroupMembership) since HasMemberRecursively() expects a Principal as parameter.
For everybody with similar problems: here you can see my working code now: my $group = new RT::Group($session{'CurrentUser'}); $group->LoadUserDefinedGroup('Members RMB'); my $principal = new RT::Principal($session{'CurrentUser'}); $principal->Load($session{'CurrentUser'}->Id); if ($group->HasMemberRecursively($principal)) { $RT::Logger->info("found: ", $group->Name); $ticket_page_tabs->{_Ca} = { title => loc('RMB'), path => "Ticket/RMB.html?id=" . $id, }; } Ben Dirk Pape schrieb: > Hello Ben, > > --Am 22. Mai 2008 18:39:12 +0200 schrieb Benjamin Weser <[EMAIL PROTECTED]>: > > >> $RT::Logger->info("User: ", $session{'CurrentUser'}->Name); >> my $groups = $session{'CurrentUser'}->UserObj->OwnGroups; >> $RT::Logger->info("Count: ", $groups->Count); >> while (my $group = $groups->Next){ >> $RT::Logger->info("test: ", $group->Name); >> if ( $group->Name =~ /Members RMB/ ){ >> $RT::Logger->info("found: ", $group->Name); >> $ticket_page_tabs->{_Ca} = { title => loc('RMB'), >> path => "Ticket/RMB.html?id=" . $id, >> }; >> } >> } >> > > I don't know why your code does not work, but I would do it other way > round: load the group and look if currentuser is a member. > > Without guarantee: > > my $group = new RT::Group($session{'CurrentUser'}); > $group->LoadUserDefinedGroup('Members RMB'); > if ($group->HasMemberRecursively($session{'CurrentUser'})) { > $ticket_page_tabs->{_Ca} = { title => loc('RMB'), > path => "Ticket/RMB.html?id=" . $id, > }; > } > > Dirk. > _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com