Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] Java code to retrieve group memberships

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] Java code to retrieve group memberships


Chronological Thread 
  • From: Andrea Biancini <>
  • To: Chris Hyzer <>
  • Cc: "" <>
  • Subject: Re: [grouper-dev] Java code to retrieve group memberships
  • Date: Wed, 19 Nov 2014 21:18:41 +0100

Thanks Chris,
I've better understood the problem!

Actually I was trying to do something which is not completely correct, so now I have some cue to enhance my code.
Thanks again!
Cheers,
Andrea

On Wed, Nov 19, 2014 at 8:36 PM, Chris Hyzer <> wrote:

findMembershipsMembers()

 

From: Andrea Biancini [mailto:]
Sent: Wednesday, November 19, 2014 2:35 PM
To: Chris Hyzer
Cc:
Subject: Re: [grouper-dev] Java code to retrieve group memberships

 

Chris, thanks for the anaswer!!

The findMembershipsGroupsMember is a private method... So I cannot call it.

I tried to call findMembership, which is public, but I get the error:

java.lang.RuntimeException: Membership must be immediate!

 

On Wed, Nov 19, 2014 at 8:26 PM, Chris Hyzer <> wrote:

This will retrieve a collection of arrays where the first index is the membership, second is the group, and third is member

 

new MembershipFinder().addSubject(subject).addGroup(group).assignField(Group.getDefaultList()).findMembershipsGroupsMembers();

 

ok?

 

Thanks,

CHris

 

From: [mailto:] On Behalf Of Andrea Biancini
Sent: Wednesday, November 19, 2014 2:11 PM
To:
Subject: [grouper-dev] Java code to retrieve group memberships

 

Hi *,

I'm writing an interface upon the Grouper Java Objects (namely the VOOT connector).

Within this interface I need, at some point, to retrieve the Membership object of a Subject within a specific Group.

For this purpose, I've so far user the following snippet of code:

<< 

Membership membership = MembershipFinder.findImmediateMembership(grouperSession, theGroup, theSubject, false);

>>

 

This works perfectly right, but only retrieves direct membership (as the method name suggest really strongly).

I was wondering how I could retrieve direct and indirect membership.

I suppose I have to use the MembershipFinder.findEffectiveMemberships method... but it has some parameters which makes it not completely clear to me how I could achieve my goal...

 

Has someone already solved a similar problem (the UI solves this problem, for instance) and is able to share a snippet of code to do obtain the membership of a user to a group (direct or indirect)?

 

Thank you very much!

Regards,

Andrea

 

--

Andrea Biancini

e-mail:
web: andrea.biancini.googlepages.com



 

--

Andrea Biancini

e-mail:
web: andrea.biancini.googlepages.com




--
Andrea Biancini

e-mail:
web: andrea.biancini.googlepages.com
tel: +39 333 2930873



Archive powered by MHonArc 2.6.16.

Top of Page