Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: getImmediateMemberships().size()

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: getImmediateMemberships().size()


Chronological Thread 
  • From: "Black, Carey M." <>
  • To: Michael Gettes <>
  • Cc: grouper-users <>
  • Subject: [grouper-users] RE: getImmediateMemberships().size()
  • Date: Thu, 23 Aug 2018 16:49:02 +0000
  • Accept-language: en-US
  • Authentication-results: spf=pass (sender IP is 128.146.138.8) smtp.mailfrom=osu.edu; internet2.edu; dkim=pass (signature was verified) header.d=osu.edu;internet2.edu; dmarc=pass action=none header.from=osu.edu;
  • Authentication-results-original: spf=none (sender IP is ) ;
  • Ironport-phdr: 9a23:rsECsBCFkefU3K7Sfa8+UyQJP3N1i/DPJgcQr6AfoPdwSPX/o8bcNUDSrc9gkEXOFd2Cra4c1KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhjexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qiqp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzdb7fc9wHX2pMRsZfWTJcDIOgYYUBDOQBMuRZr4bhqFUBogCzBRW3C+/z1jNEmmP60K883u88EQ/GxgsgH9cWvXjasdj1ML0dXvy2zKXQ0D7OcelZ2S3j54nIbxsvpuuAUbxtesfW0kYvExnKgUmTqYD/Ij+ZyOoAvnOc7+p7SOKjkXAopBxsojW2wMonl4fHhoUQyl/e9CV5xp44Jdy+SE5nf9GkCp1QuD+GN4doWM8tXXxnuDs8x7YbupC7ZDAHxIk7yxPQcfCKfIqF7gjtWeueOzt1gHZodKqiixuz/kWs0PDwWtW23VpQsCZIndjBumoQ2xHc68WLUvV98Vmi1DqT0g3e7+JJLl0qmaXALpMu36M/m5UNvUnGAyD7l0T7gaCTe0o5++Wl7+rnb7P7rZGGLYB0kBvxMqE2l8y/H+s4Ng8OUnCD9+mg07Pv4VD1TKxXg/I0jKXVqZfaKt8FqaKjBA9Vz5oj5A24Dze71tQXgGMLLEpfeBKAk4jmJU3BIOz5Dfe4hVSgijBrx+3aPr3lBZXNKXvDnK39crZ67k5Q0AszzdZB6JJIErwNPe7/V0DruNHXDBI1KQK5zun9BNh50o4SQWePDbWYMKPWv1+I/OUvI+yUaYAOvDbyMeQq5/30gXMkh1MQc7Kk3ZwMaHClBPhpPViWYWf0jtcbDWgKphY+TPDtiFCaXj5TfXGyX78k5j4lEoKqFJrDRpuzj7ybxye2BZlWZmFdClCQCnfkaZ+IW/YKaCKOPMBhiDoEWqa9S4M/zx2hqhL1y6c0ZtbTrwgZvpLq2dw9yODPiRwpvWh7AtiB3nqlUm9w2G4EWmll8rp4pBk34FOK2qs8y9dRD9FCr9YPGE9uP5rVxO88UoqpcgXaY5GEREvwEYbuOi04Ut9km4xGWE16Adj3y0mbh3DwUbYIi7yGAoA1+avA3n/3Ytxw0GvCyLJ43gF0WdNBYHWvnbU3txPeAYLEiQ24r+6rbuxFhn6LrTvdizPV7AcIEWsSGb7AQWhZY0LXqdrj4UaXSKSzT7krL1gJyMieJ7FMZ8Gzy1hKWaSrNNffZjepknyrTVaTx7yKZZb3YWhVwyzGQFYJiQEd/HuKdG1cTiesqm7TFnpiQFX0fgXh/fQtqXWnQ1Uywh3QKUBtyun99hscn/fJU/oIxfoNszsgrDMhGlG70prWBtOMqhAncr9bZIY6+0oB2G7E5AE=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Michael,

Composites don’t have "Direct/Immediate members". They have a "left and right
factor groups" that determine the membership.

REF: https://spaces.at.internet2.edu/display/Grouper/Glossary
( a bit out of order from the page, but intended to build on the terms in a
"good" order for this question. )

Terms are defined as this in Grouper:

Composite Group
A Group whose Membership is determined by combining the membership
lists of two other groups, without listing its members explicitly. These two
groups are called its Factor Groups. Three methods of combining the factor
groups' memberships are supported:

Direct Membership
A Subject that is listed in the Membership list of a Group has a
direct membership in the group. Also see Indirect Membership.

Indirect Membership
A Subject that is a member of a Subgroup of a Group, or a member of a
Factor Group that contributes positively to a group's membership, has an
indirect membership in the group. Also see Direct Membership.


( And now the "kicker....)

Membership
The direct-only, indirect-only, or direct plus indirect members of a
Group. A specific variety of membership is determined by context or
configuration, i.e., the default User Interface allows the user to select
among these three types of membership where appropriate.
So... "Membership" is the "super set" and the other sub-types of memberships
have more focus/specific definitions.



Now to the GSH/grouper api....


A working example...
I created 3 groups.
myList
myRemoveList
myComposite ( which is: myList minus myRemoveList )

then in GSH...

rsess = GrouperSession.startRootSession(); // start with all system level
access [ NOTE: this could also be a headache for seeing memberships too... ]

g = GroupFinder.findByName(rsess, "users:folders:black.123:myComposite",
true);
g.getImmediateMemberships() // returns and empty list []
g.getImmediateMemberships().size() // returns the count of Immediate members
in the composite = 0 ( Expected )
g.getNonImmediateMembers() // returns the list of subjects as expected.

// here is the kicker again...
g.getMemberships().size() // returns count of users and groups from the group
math ( zero or 1 form my testing.)

// but this looks odd... ( bug? )
g.getEffectiveMemberships().size() // ALWAYS returns zero... hum..(?? not
expected??)
g.getEffectiveMemberships() // ALWAYS returns empty list... hum..(?? not
expected??)
ALSO NOTE: "Effective Membership" is not in the Grouper Glossary. :(

However... looking at the code...

grouper.edu.internet2.middleware.grouper.Group. getEffectiveMembers()
/**
* Get effective members of this group.
*
* An effective member has an indirect membership to a group
* (e.g. in a group within a group). All subjects in a
* composite group are effective members (since the composite
* group has two groups and a set operator and no other immediate
* members). Note that a member can have 0 to 1 immediate memberships
* to a single group, and 0 to many effective memberships to a group.
* 'group within a group' can be nested to any level so long as it does
* not become circular. A group can have potentially unlimited effective
* memberships
....
*/


NOTE: my test env is currently patched like this:
api patches installed: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
107, 108, 109

Hope that helps...

--
Carey Matthew



-----Original Message-----
From:


<>
On Behalf Of Carl Waldbieser
Sent: Thursday, August 23, 2018 11:36 AM
To: Michael Gettes
<>
Cc: grouper-users
<>
Subject: Re: [grouper-users] getImmediateMemberships().size()

Michael,

The scripting language is just syntactic flavor. They are all using the same
Grouper API.
`g.members` is the `members` property of the group instance. It may
literally be `Group.getMembers()` but most scripting languages will allow you
to use either the method or property form.
You should still be able to call `.size()` on it. The important bit is that
it is `members` rather than `effectiveMembers` or `immediateMembers`.

Thanks,
Carl

----- Original Message -----
From: "Michael Gettes"
<>
To: "waldbiec"
<>
Cc: "grouper-users"
<>
Sent: Thursday, 23 August, 2018 11:31:40
Subject: Re: [grouper-users] getImmediateMemberships().size()

Thanks Carl - this isn’t python - grouper shell and groovy. Is it still
g.members and someway of getting the count?

/mrg

> On Aug 23, 2018, at 11:27 AM, Carl Waldbieser
> <>
> wrote:
>
> Michael,
>
> Where `g` is a composite group, from the Python shell wrapper:
>
>>>> x = g.members
>>>> type(x)
> <type 'java.util.LinkedHashSet'>
>>>> len(x)
> 22
>>>>
>
> Thanks,
> Carl Waldbieser
> ITS Identity Management
> Lafayette College
>
> ----- Original Message -----
> From: "Michael Gettes"
> <>
> To: "grouper-users"
> <>
> Sent: Thursday, 23 August, 2018 11:01:31
> Subject: [grouper-users] getImmediateMemberships().size()
>
> I am calling getImmediateMemberships().size() and
> getEffectiveMemberships().size() on a composite and both are returning zero.
>
> Doing this from grouper groovy shell.
>
> Advice?
>
> /mrg



Archive powered by MHonArc 2.6.19.

Top of Page