|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AccessAdapter
Grouper Access Privilege interface.
Unless you are implementing a new implementation of this interface,
you should not need to directly use these methods as they are all
wrapped by methods in the Group
class.
Method Summary | |
---|---|
Set<Group> |
getGroupsWhereSubjectHasPriv(GrouperSession s,
edu.internet2.middleware.subject.Subject subj,
Privilege priv)
Get all groups where this subject has this privilege. |
Set<AccessPrivilege> |
getPrivs(GrouperSession s,
Group g,
edu.internet2.middleware.subject.Subject subj)
Get all privileges held by this subject on this group. |
Set<edu.internet2.middleware.subject.Subject> |
getSubjectsWithPriv(GrouperSession s,
Group g,
Privilege priv)
Get all subjects with this privilege on this group. |
void |
grantPriv(GrouperSession s,
Group g,
edu.internet2.middleware.subject.Subject subj,
Privilege priv)
Grant the privilege to the subject on this group. |
boolean |
hasPriv(GrouperSession s,
Group g,
edu.internet2.middleware.subject.Subject subj,
Privilege priv)
Check whether the subject has this privilege on this group. |
boolean |
hqlFilterGroupsWhereClause(GrouperSession grouperSession,
edu.internet2.middleware.subject.Subject subject,
HqlQuery hqlQuery,
StringBuilder hql,
String groupColumn,
Set<Privilege> privInSet)
for a group query, check to make sure the subject can see the records (if filtering HQL, you can do the postHqlFilterGroups instead if you like). |
Set<Group> |
postHqlFilterGroups(GrouperSession grouperSession,
Set<Group> groups,
edu.internet2.middleware.subject.Subject subject,
Set<Privilege> privInSet)
after HQL is run, filter groups. |
Set<Membership> |
postHqlFilterMemberships(GrouperSession grouperSession,
edu.internet2.middleware.subject.Subject subject,
Set<Membership> memberships)
filter memberships for things the subject can see |
void |
privilegeCopy(GrouperSession s,
Group g1,
Group g2,
Privilege priv)
Copies privileges for subjects that have the specified privilege on g1 to g2. |
void |
privilegeCopy(GrouperSession s,
edu.internet2.middleware.subject.Subject subj1,
edu.internet2.middleware.subject.Subject subj2,
Privilege priv)
Copies privileges of type priv on any subject for the given Subject subj1 to the given Subject subj2. |
void |
revokeAllPrivilegesForSubject(GrouperSession grouperSession,
edu.internet2.middleware.subject.Subject subject)
Revoke all access privileges that this subject has. |
void |
revokePriv(GrouperSession s,
Group g,
Privilege priv)
Revoke this privilege from everyone on this group. |
void |
revokePriv(GrouperSession s,
Group g,
edu.internet2.middleware.subject.Subject subj,
Privilege priv)
Revoke the privilege from the subject on this group. |
Method Detail |
---|
Set<edu.internet2.middleware.subject.Subject> getSubjectsWithPriv(GrouperSession s, Group g, Privilege priv) throws SchemaException
Set admins = ap.getSubjectsWithPriv(s, g, AccessPrivilege.ADMIN);
s
- Get privileges within this session context.g
- Get privileges on this group.priv
- Get this privilege.
Subject
objects.
SchemaException
Set<Group> getGroupsWhereSubjectHasPriv(GrouperSession s, edu.internet2.middleware.subject.Subject subj, Privilege priv) throws SchemaException
try { Set isAdmin = ap.getGroupsWhereSubjectHasPriv( s, subj, AccessPrivilege.ADMIN ); } catch (SchemaException eS) { // Invalid priv }
s
- Get privileges within this session context.subj
- Get privileges for this subject.priv
- Get this privilege.
Group
objects.
SchemaException
Set<AccessPrivilege> getPrivs(GrouperSession s, Group g, edu.internet2.middleware.subject.Subject subj)
Set privs = ap.getPrivs(s, g, subj);
s
- Get privileges within this session context.g
- Get privileges on this group.subj
- Get privileges for this member.
void grantPriv(GrouperSession s, Group g, edu.internet2.middleware.subject.Subject subj, Privilege priv) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { ap.grantPriv(s, g, subj, AccessPrivilege.ADMIN); } catch (GrantPrivilegeException e0) { // Unable to grant the privilege } catch (InsufficientPrivilegeException e1) { // Not privileged to grant the privilege } catch (SchemaException e2) { // Invalid privilege }
s
- Grant privilege in this session context.g
- Grant privilege on this group.subj
- Grant privilege to this subject.priv
- Grant this privilege.
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
boolean hasPriv(GrouperSession s, Group g, edu.internet2.middleware.subject.Subject subj, Privilege priv) throws SchemaException
try { ap.hasPriv(s, g, subject, AccessPrivilege.ADMIN); } catch (SchemaException e) { // Invalid privilege }
s
- Check privilege in this session context.g
- Check privilege on this group.subj
- Check privilege for this subject.priv
- Check this privilege.
SchemaException
void revokePriv(GrouperSession s, Group g, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { ap.revokePriv(s, g, AccessPrivilege.ADMIN); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke the privilege } catch (RevokePrivilegeException eRP) { // Unable to revoke the privilege }
s
- Revoke privilege in this session context.g
- Revoke privilege on this group.priv
- Revoke this privilege.
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
void revokePriv(GrouperSession s, Group g, edu.internet2.middleware.subject.Subject subj, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { ap.revokePriv(s, g, subj, AccessPrivilege.ADMIN); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke the privilege } catch (RevokePrivilegeException eRP) { // Unable to revoke the privilege }
s
- Revoke privilege in this session context.g
- Revoke privilege on this group.subj
- Revoke privilege from this subject.priv
- Revoke this privilege.
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
void privilegeCopy(GrouperSession s, Group g1, Group g2, Privilege priv) throws InsufficientPrivilegeException, GrantPrivilegeException, SchemaException
s
- g1
- g2
- priv
-
InsufficientPrivilegeException
GrantPrivilegeException
SchemaException
void privilegeCopy(GrouperSession s, edu.internet2.middleware.subject.Subject subj1, edu.internet2.middleware.subject.Subject subj2, Privilege priv) throws InsufficientPrivilegeException, GrantPrivilegeException, SchemaException
s
- subj1
- subj2
- priv
-
InsufficientPrivilegeException
GrantPrivilegeException
SchemaException
Set<Group> postHqlFilterGroups(GrouperSession grouperSession, Set<Group> groups, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privInSet)
grouperSession
- groups
- subject
- which needs view access to the groupsprivInSet
- find a privilege which is in this set
(e.g. for view, send all access privs). There are pre-canned sets in AccessAdapter
boolean hqlFilterGroupsWhereClause(GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, HqlQuery hqlQuery, StringBuilder hql, String groupColumn, Set<Privilege> privInSet)
grouperSession
- subject
- which needs view access to the groupshql
- is the select and part part (hql prefix)hqlQuery
- groupColumn
- is the name of the group column to join toprivInSet
- find a privilege which is in this set
(e.g. for view, send all access privs). There are pre-canned sets in AccessPrivilege
Set<Membership> postHqlFilterMemberships(GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Membership> memberships)
grouperSession
- memberships
- subject
-
void revokeAllPrivilegesForSubject(GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject)
grouperSession
- subject
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |