Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] naming a group as a subject with gsh

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] naming a group as a subject with gsh

Chronological Thread 
  • From: Chris Hyzer <>
  • To: Scott Koranda <>, "" <>
  • Subject: RE: [grouper-users] naming a group as a subject with gsh
  • Date: Mon, 2 Feb 2009 12:37:11 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

The second arg to the grantPriv gsh call is subjectId, and the subjectId of a
group is its uuid and not its name. So this will work:

gsh 0% GrouperSession grouperSession = GrouperSession.startRootSession();
gsh 1% Group group = GroupFinder.findByName(grouperSession,
gsh 2% grantPriv("aStem", group.getUuid(), NamingPrivilege.STEM)
gsh 3%

However, we have seen this confusion before, and I suggest we:

Change subjectId calls in GSH to use SubjectFinder.findByIdOrIdentifier(),
which would handle this case, and probably others where it is a little
confusing. This works by first looking by ID, and if it finds the subject,
use it. If not, then search by identifier (which in this case the group name
is an identifier). Any reasons not to do this?


> -----Original Message-----
> From: Scott Koranda
> [mailto:]
> Sent: Monday, February 02, 2009 12:02 PM
> To:
> Subject: [grouper-users] naming a group as a subject with gsh
> I want to use the grantPriv() method in gsh to grant
> the NamingPrivilege.STEM privilege to an existing group. When
> I invoke grantPriv() as
> grantPriv("A:B", "A:B:C", NamingPrivilege.STEM)
> so that members of group "A:B:C" are granted the privilege on
> stem "A:B" I receive the error
> // Error: subject not found: A:B:C
> I tried using GroupFinder.findByName() to retrieve the group
> as an object and the retrieval worked, but I cannot input
> the group object as the second argument to grantPriv() as it
> returns an error.
> How can I set the privilege on "A:B" for members of group
> "A:B:C"?
> Scott

Archive powered by MHonArc 2.6.16.

Top of Page