Skip to Content.
Sympa Menu

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

Subject: Grouper Users - Open Discussion List

List archive

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


Chronological Thread 
  • From: "Gettes, Michael" <>
  • To: grouper-users <>
  • Subject: Re: [grouper-users] RE: getImmediateMemberships().size()
  • Date: Thu, 23 Aug 2018 22:36:39 +0000
  • Accept-language: en-US
  • Ironport-phdr: 9a23:gGFYVh2b4LkjuR1VsmDT+DRfVm0co7zxezQtwd8ZseISKvad9pjvdHbS+e9qxAeQG9mDtLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmiDkJOSMl8G/ZicJwgqBUrhWgpxNjzIDbb5qYNOZlcaPYYd8aRXZNU8RXWidcAo28dYwPD+8ZMOpWrofyuUcOrQegCgm3HO/k1zhGhn7q0q06yesuDwXG0AI9FN8Jv3Tbssn1NLsMXuCu16TI0DvDb/dM1Tjj9YfIbwksrPeRVrx+dsrRzFMgFwLDjliIsYzlJTSV1uMDs2iD6OpgVOSvi3I9pw5tpTivw8EhgZTKiIIN0l3I6Dt1zYUvKdGmVkJ2Y8SoHZlfui2AKYd6XN8uT3l1tCom0LELt5+2cDIXxJkpyBPTceGLfomQ7hLtSumcIit0iXdgdb+8gxu+7VSvx+jgWcavyllHri9InsfOu38WyRDe79WIReBj8kqj3zuEyhrd5fteIU8ukKrWM54hzaA0lpoUqUnDBSr2mFnujKOMa0Uk9Oyo5/75bbr7u5+QL450igfgPaQygsGzHPo0PwsUU2SF5+ix1qfv8E/2TblQkPE6jLXVvIjfJcsBp665BwFV0pwk6xa6Fzqm38oXnWUbLF1bYxKKlJXpO1/KIPziE/iwnkmsnC9xx//aJr3hHonNLn/bnbfuZ7Z97FNcyBItwtBF/p5UF6oBL+zpWk/qr9HYCh45Mxeow+b8FtlxzIIeWWSTAqCHKqPSt0GH5v4xL+WWeoAapSv9eLAZ4Kvhl3gkgVIHOLSy0IEMICS3BPN7O0iDJGf3j80aOWYMogckSuH20huPXSMFNFioWKdprB42FJ6rFsOLY4GmgLWM2G3zSpJbenxLEXiRH3OueomZDaRfIBmOK9Nsx2RXHYOqTJUsgEmj

Thanks Carey. As you noted, always returns zero - and that’s what I am
seeing. I am using TIER docker images and I am still on api patch 108.
getEffective is what I am really interested in having work properly against
composites. I know you know that I understand grouper and the memberships -
thanks for setting the stage so others might appreciate what is being done.
Yes, I have read the code about effectiveMemberships and that’s exactly why I
was trying to use it. Seems like a bug???

And Carl - thank you as well for your assistance. I will make use of
getMembers for now but I need to see if it has the semantics related to
effectiveMemberships I am seeking.

/mrg

> On Aug 23, 2018, at 12:49 PM, Black, Carey M.
> <>
> wrote:
>
> Michael,
>
> Composites don’t have "Direct/Immediate members". They have a "left and
> right factor groups" that determine the membership.
>
> REF:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__spaces.at.internet2.edu_display_Grouper_Glossary&d=DwIGaQ&c=pZJPUDQ3SB9JplYbifm4nt2lEVG5pWx2KikqINpWlZM&r=EUBHI54mtQDlbcqo5rUTdQ&m=HmCxd5SVe4caJxO2xzgfKe1A-X8mEQTXoAG3Q_GqZ5c&s=P6hZPO8CEFVKw-FY0KkDkdunRlDKGLtEk_ak1hjqe30&e=
> ( 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