Skip to Content.
Sympa Menu

grouper-users - RE: RE: [grouper-users] gsh scripting

Subject: Grouper Users - Open Discussion List

List archive

RE: RE: [grouper-users] gsh scripting


Chronological Thread 
  • From: Chris Hyzer <>
  • To: mohan shamachar <>, "" <>
  • Subject: RE: RE: [grouper-users] gsh scripting
  • Date: Fri, 19 Apr 2013 18:38:31 +0000
  • Accept-language: en-US
  • Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none

If you want to know via SQL, you should be able to (note, this means they are
assigned, it doesn't mean the assignments are active, or that they are
"allowed":

> get all attributes assigned to a role

Assuming direct assignment (unassignable)

SELECT GPAV.ATTRIBUTE_DEF_NAME_NAME
FROM grouper_perms_all_v gpav
WHERE GPAV.ROLE_NAME = 'a:b'
AND gpav.permission_type = 'role'
AND GPAV.ROLE_SET_DEPTH = 0
AND GPAV.ATTR_ASSIGN_ACTION_SET_DEPTH = 0
AND GPAV.ATTR_DEF_NAME_SET_DEPTH = 0
AND GPAV.MEMBERSHIP_DEPTH = 0

via the API (and GSH), you should be able to get this from the
PermissionFinder chained query class:

for (PermissionEntry permissionEntry : new
PermissionFinder().assignPermissionType(PermissionType.role)
.assignImmediateOnly(true).addRole("a:b").findPermissions()) {
System.out.println(permissionEntry.getAttributeDefNameName());
}

> all roles that are assigned a given attribute

Assuming direct assignment (unassignable)

select GPAV.role_name from grouper_perms_all_v gpav where
GPAV.ATTRIBUTE_DEF_NAME_NAME = 'a:b'
and gpav.permission_type = 'role'
and GPAV.ROLE_SET_DEPTH = 0 and GPAV.ATTR_ASSIGN_ACTION_SET_DEPTH = 0
and GPAV.ATTR_DEF_NAME_SET_DEPTH = 0 and GPAV.MEMBERSHIP_DEPTH = 0

via the API (and GSH), you should be able to get this from the
PermissionFinder chained query class:

for (PermissionEntry permissionEntry : new
PermissionFinder().assignPermissionType(PermissionType.role)
.assignImmediateOnly(true).addPermissionName("a:b").findPermissions()) {
System.out.println(permissionEntry.getRoleName());
}

I documented this here:

https://spaces.internet2.edu/display/Grouper/Grouper+Role+and+Permission+Management

Thanks,
Chris


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


[mailto:]
On Behalf Of mohan shamachar
Sent: Friday, April 19, 2013 2:03 PM
To:

Subject: Re: RE: [grouper-users] gsh scripting

Thank you. obliterateStem removed everything from given stem name.

It will be nice to know via gsh or DAO or Sql, how to iterate different
collections...

get all attributes assigned to a role

all roles that are assigned a given attribute

best,
mohan



Archive powered by MHonArc 2.6.16.

Top of Page