Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Group for which member has "view" but not "read" not visible under "My memberships"

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Group for which member has "view" but not "read" not visible under "My memberships"


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "GW Brown, Information Systems and Computing" <>, "" <>, Grouper Users Mailing List <>
  • Subject: RE: [grouper-users] Group for which member has "view" but not "read" not visible under "My memberships"
  • Date: Fri, 13 Mar 2009 02:37:43 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US



This is fixed in branch 1.4 (need new UI from cvs) (will propagate to the
anonymous cvs in a couple of hours)

cvs
-d:pserver::/home/cvs/i2mi
login
cvs
-d:pserver::/home/cvs/i2mi
export -r GROUPER_UI_1_4_BRANCH grouper-ui

There are two threadlocals in GrouperSession... one static one, and a stack
of them for the callback inverse of control. If you are in an inverse of
control (preferred method), then it takes precedence. If not, then if there
is a static, then use it. I admit this is confusing. I added some javadoc
to GrouperSession constructor.

* threadlocal which replaces the current one. Though if in the context of
a callback,
* the callback has precedence, and you should use an inner callback to
preempt it (callbackGrouperSession)

So the correct code for the method is (since the inverse of control is in
use):

if (validStems != null)
return validStems;
GrouperSession s = GrouperSession.startRootSession(true);
Set groups = (Set)GrouperSession.callbackGrouperSession(s, new
GrouperSessionHandler() {

public Object callback(GrouperSession grouperSession)
throws GrouperSessionException {
Subject curSubj = getGrouperSession().getSubject();
Member member = MemberFinder.findBySubject(grouperSession, curSubj);
Set groupSet = member.getGroups();
return groupSet;
}

});
s.stop();
...

Just thought I would mention (obviously), if you are trying to reproduce,
make sure the user clicking "my memberships" is a regular member of the
group, and a viewer, and grouperAll is not a viewer or member...

Let me know how it goes.

Kind regards,
Chris


> -----Original Message-----
> From: GW Brown, Information Systems and Computing
> [mailto:]
> Sent: Thursday, March 12, 2009 7:31 AM
> To:
> ;
> Grouper Users Mailing List
> Subject: Re: [grouper-users] Group for which member has "view" but not
> "read" not visible under "My memberships"
>
> Hi Loris,
>
> That is a bug. When browsing / searching in 'My memberships' the code
> calls
> member.getGroups() and checks whether the 'result' is in the result
> set.
> Unfortunately, if the logged in user does not have READ access to the
> group, the API filters the result set so no match is possible. I've had
> a
> quick go at fixing it but without any luck.
>
> Chris: In MyMembershipsRepositoryBrowser (HEAD) I've changed the method
> below:
>
> protected Map getValidStems() throws Exception{
> Map validStems = savedValidStems;
> if(validStems !=null) return validStems;
> Set groups = null;
> GrouperSession s = GrouperSession.startRootSession(true);
> Subject curSubj = getGrouperSession().getSubject();
> Member member = MemberFinder.findBySubject(s,curSubj);
> groups = member.getGroups();
> s.stop();
> return getStems(groups);
> }
>
> so that I start a root session, however, member.getGroups() doesn't use
> that session - it still uses the session of the logged in user. Any
> ideas?
>
> Gary
>
>
> --On 12 March 2009 10:43 +0000 "Dr. Loris Bennett"
> <>
> wrote:
>
> > Hi,
> >
> > I have a user who is a member of two groups: "read_only" and
> > "view_only". In the first, the user has read permission only, in the
> > second, view permission only.
> >
> > If the users explores to the folder containing the two groups, both
> are
> > displayed, but only "read_only" has a link "manage members". This is
> OK,
> > although it would be nicer if the link were labelled "view members"
> in
> > this case.
> >
> > However, when the users clicks on "My Memberships, only "read_only"
> is
> > displayed. Surely both groups should be displayed here, too?
> >
> > Cheers
> >
> > Loris
> >
> > --
> > Dr. Loris Bennett (Mr.)
> > Freie Universität Berlin
> > ZEDAT - Zentraleinrichtung für Datenverarbeitung / Computer Center
> > Compute & Media Service
> > Fabeckstr. 32, Room 221
> > D-14195 Berlin
> > Tel ++49 30 838 51024
> > Fax ++49 30 838 56721
> > Email
> >
> > Web www.zedat.fu-berlin.de
> >
>
>
>
> ----------------------
> GW Brown, Information Systems and Computing
>



Archive powered by MHonArc 2.6.16.

Top of Page