Determining Group Membership

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  • -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

I’d like to make my custom ticket creation for automatically turn on
SELECTED for the a particular group in the Group listbox.

perldoc Users_Overlay cites:

   MemberOfGroup PRINCIPAL_ID

   takes one argument, a group's principal id. Limits the
   returned set to members of a given group

So I tried adding this to INIT:
use RT::Users
my $UserObj = new RT::Users($session{‘CurrentUser’});

and this to the main portion of the form:

% print “

\n:::”, $UserObj->MemberOfGroup(336), “:::

\n”;

It prints out :::CachedGroupMembers_2:::

I also tried:

user RT::Group;
my $GroupObj = new RT::Group($session{‘CurrentUser’});

% print “

\n:::”, $GroupObj->MembersObj(336), "  :::

\n";

Which returns:

:::RT::GroupMembers=HASH(0x96d4e28):::

I’ve verified that this is the group id I’m looking for:

rt3=# select * from groups where id = ‘336’;
id | name | description | domain | type | instance

    • -----±-------±-------------------±------------±-----±---------
      336 | SysOps | Systems Operations | UserDefined | |
      (1 row)

rt3=# select * from principals where id = ‘336’;
id | principaltype | objectid | disabled

    • -----±--------------±---------±---------
      336 | Group | 336 | 0
      (1 row)

Could anyone shed any light on how to do this?

Thanx!


Andy Harrison
(full headers for details)

  • -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/4gi2CYaHi6DasBoRAsMHAJ4+LEeGphSdOFzpvTo6LozP2fYN8gCgjf2O
jiRnMmUj2dbSOxqVufENKrk=
=2zGV

  • -----END PGP SIGNATURE-----

Andy Harrison
(full headers for details)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/6G86CYaHi6DasBoRAiaOAJ0XPNkMJLJE6bpE0+k0qjlrYoQZaQCeNqAj
27vN20vEGZjBdukQs0993GA=
=ySEA
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’d like to make my custom ticket creation for automatically turn on
SELECTED for the a particular group in the Group listbox.

perldoc Users_Overlay cites:

   MemberOfGroup PRINCIPAL_ID

   takes one argument, a group's principal id. Limits the
   returned set to members of a given group

So I tried adding this to INIT:
use RT::Users
my $UserObj = new RT::Users($session{‘CurrentUser’});

and this to the main portion of the form:

% print “

\n:::”, $UserObj->MemberOfGroup(336), “:::

\n”;

It prints out :::CachedGroupMembers_2:::

I also tried:

user RT::Group;
my $GroupObj = new RT::Group($session{‘CurrentUser’});

% print “

\n:::”, $GroupObj->MembersObj(336), "  :::

\n";

Which returns:

:::RT::GroupMembers=HASH(0x96d4e28):::

I’ve verified that this is the group id I’m looking for:

rt3=# select * from groups where id = ‘336’;
id | name | description | domain | type | instance

  • -----±-------±-------------------±------------±-----±---------
    336 | SysOps | Systems Operations | UserDefined | |
    (1 row)

rt3=# select * from principals where id = ‘336’;
id | principaltype | objectid | disabled

  • -----±--------------±---------±---------
    336 | Group | 336 | 0
    (1 row)

Could anyone shed any light on how to do this?

Thanx!


Andy Harrison
(full headers for details)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/4gi2CYaHi6DasBoRAsMHAJ4+LEeGphSdOFzpvTo6LozP2fYN8gCgjf2O
jiRnMmUj2dbSOxqVufENKrk=
=2zGV
-----END PGP SIGNATURE-----

Andy Harrison
(full headers for details)

Andy Harrison
(full headers for details)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’d like to make my custom ticket creation for automatically turn on
SELECTED for the a particular group in the Group listbox.

perldoc Users_Overlay cites:

   MemberOfGroup PRINCIPAL_ID

   takes one argument, a group's principal id. Limits the
   returned set to members of a given group

So I tried adding this to INIT:
use RT::Users
my $UserObj = new RT::Users($session{‘CurrentUser’});

and this to the main portion of the form:

% print “

\n:::”, $UserObj->MemberOfGroup(336), “:::

\n”;

It prints out :::CachedGroupMembers_2:::

I also tried:

user RT::Group;
my $GroupObj = new RT::Group($session{‘CurrentUser’});

% print “

\n:::”, $GroupObj->MembersObj(336), "  :::

\n";

Which returns:

:::RT::GroupMembers=HASH(0x96d4e28):::

I’ve verified that this is the group id I’m looking for:

rt3=# select * from groups where id = ‘336’;
id | name | description | domain | type | instance

  • -----±-------±-------------------±------------±-----±---------
    336 | SysOps | Systems Operations | UserDefined | |
    (1 row)

rt3=# select * from principals where id = ‘336’;
id | principaltype | objectid | disabled

  • -----±--------------±---------±---------
    336 | Group | 336 | 0
    (1 row)

Could anyone shed any light on how to do this?

Thanx!


Andy Harrison
(full headers for details)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/4gi2CYaHi6DasBoRAsMHAJ4+LEeGphSdOFzpvTo6LozP2fYN8gCgjf2O
jiRnMmUj2dbSOxqVufENKrk=
=2zGV
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’d like to make my custom ticket creation for automatically turn on
SELECTED for the a particular group in the Group listbox.

perldoc Users_Overlay cites:

   MemberOfGroup PRINCIPAL_ID

   takes one argument, a group's principal id. Limits the
   returned set to members of a given group

So I tried adding this to INIT:
use RT::Users
my $UserObj = new RT::Users($session{‘CurrentUser’});

and this to the main portion of the form:

% print “

\n:::”, $UserObj->MemberOfGroup(336), “:::

\n”;

It prints out :::CachedGroupMembers_2:::

I also tried:

user RT::Group;
my $GroupObj = new RT::Group($session{‘CurrentUser’});

% print “

\n:::”, $GroupObj->MembersObj(336), "  :::

\n";

Which returns:

:::RT::GroupMembers=HASH(0x96d4e28):::

I’ve verified that this is the group id I’m looking for:

rt3=# select * from groups where id = ‘336’;
id | name | description | domain | type | instance

  • -----±-------±-------------------±------------±-----±---------
    336 | SysOps | Systems Operations | UserDefined | |
    (1 row)

rt3=# select * from principals where id = ‘336’;
id | principaltype | objectid | disabled

  • -----±--------------±---------±---------
    336 | Group | 336 | 0
    (1 row)

Could anyone shed any light on how to do this?

Thanx!


Andy Harrison
(full headers for details)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/4gi2CYaHi6DasBoRAsMHAJ4+LEeGphSdOFzpvTo6LozP2fYN8gCgjf2O
jiRnMmUj2dbSOxqVufENKrk=
=2zGV
-----END PGP SIGNATURE-----

Andy Harrison
(full headers for details)

Andy Harrison wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’d like to make my custom ticket creation for automatically turn on
SELECTED for the a particular group in the Group listbox.

perldoc Users_Overlay cites:

   MemberOfGroup PRINCIPAL_ID

   takes one argument, a group's principal id. Limits the
   returned set to members of a given group

So I tried adding this to INIT:
use RT::Users
my $UserObj = new RT::Users($session{‘CurrentUser’});

and this to the main portion of the form:

% print “

\n:::”, $UserObj->MemberOfGroup(336), “:::

\n”;

It prints out :::CachedGroupMembers_2:::
Hello, Andy.
I didn’t understand what do you want to finaly get.
So I just writed test.html which show all user defined groups and their
members:

% while(my $Group = $Groups->Next) { <% $Group->Name %>
% my $UserMembers = $Group->UserMembersObj;

% while(my $User = $UserMembers->Next) { "<% $User->RealName || $User->Name || $User->Login %>" <<% $User->EmailAddress %>>
% }

% } <%INIT> use RT::Groups;

my $Groups = new RT::Groups($session{‘CurrentUser’});
$Groups->LimitToUserDefinedGroups();

</%INIT>

I think that you have to send more info:
What list of or instance do you want to get at the end?

Don’t resend your letters(questions) without refactoring. People didn’t
answer you because your question was bad formed.

Best regards. Ruslan.