Class GrouperNonDbAccessAdapter
java.lang.Object
edu.internet2.middleware.grouper.privs.BaseAccessAdapter
edu.internet2.middleware.grouper.privs.GrouperNonDbAccessAdapter
- All Implemented Interfaces:
AccessAdapter
- Direct Known Subclasses:
GrouperAccessAdapter
This is the base grouper implementation which implements the required
access adapter methods, but not the db specific ones. This should be
slower and more explicit than the GrouperAccessAdapter (subclass)
- Version:
- $Id: GrouperNonDbAccessAdapter.java,v 1.8 2009-12-07 07:31:09 mchyzer Exp $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGroupsWhereSubjectDoesHavePrivilege(GrouperSession grouperSession, String stemId, Stem.Scope scope, Subject subject, Privilege privilege, boolean considerAllSubject, String sqlLikeString) Get all groups where this subject does have this privilege.getGroupsWhereSubjectDoesntHavePrivilege(GrouperSession grouperSession, String stemId, Stem.Scope scope, Subject subject, Privilege privilege, boolean considerAllSubject, String sqlLikeString) Get all groups where this subject doesnt have this privilege.getGroupsWhereSubjectHasPriv(GrouperSession s, Subject subj, Privilege priv) Get all groups where this subject has this privilege.getPrivs(GrouperSession s, Group g, Subject subj) Get all privileges held by this subject on this group.getStemsWhereGroupThatSubjectHasPrivilege(GrouperSession grouperSession, Subject subject, Privilege privilege) get stems where a group exists where the subject has privilegegetSubjectsWithPriv(GrouperSession s, Group g, Privilege priv) Get all subjects with this privilege on this group.voidGrant the privilege to the subject on this group.booleanhasPriv(GrouperSession s, Group g, Subject subj, Privilege priv) Check whether the subject has this privilege on this group.voidprivilegeCopy(GrouperSession s, Group g1, Group g2, Privilege priv) Copies privileges for subjects that have the specified privilege on g1 to g2.voidprivilegeCopy(GrouperSession s, Subject subj1, Subject subj2, Privilege priv) Copies privileges of type priv on any subject for the given Subject subj1 to the given Subject subj2.retrievePrivileges(GrouperSession grouperSession, Group group, Set<Privilege> privileges, MembershipType membershipType, QueryPaging queryPaging, Set<Member> additionalMembers) get a list of privilege subjects, there are no results with the same subject/privilege combinationvoidrevokeAllPrivilegesForSubject(GrouperSession grouperSession, Subject subject) Revoke all access privileges that this subject has.voidrevokePriv(GrouperSession s, Group g, Privilege priv) Revoke this privilege from everyone on this group.voidrevokePriv(GrouperSession s, Group g, Subject subj, Privilege priv) Revoke the privilege from the subject on this group.Methods inherited from class edu.internet2.middleware.grouper.privs.BaseAccessAdapter
hqlFilterGroupsNotWithPrivWhereClause, hqlFilterGroupsWhereClause, hqlFilterGroupsWithPrivWhereClause, postHqlFilterGroups, postHqlFilterMemberships, postHqlFilterStemsWithGroupsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.internet2.middleware.grouper.privs.AccessAdapter
hqlFilterGroupsNotWithPrivWhereClause, hqlFilterGroupsWhereClause, hqlFilterGroupsWithPrivWhereClause, postHqlFilterGroups, postHqlFilterMemberships, postHqlFilterStemsWithGroups
-
Field Details
-
priv2list
-
-
Constructor Details
-
GrouperNonDbAccessAdapter
public GrouperNonDbAccessAdapter()
-
-
Method Details
-
getSubjectsWithPriv
Description copied from interface:AccessAdapterGet all subjects with this privilege on this group.Set admins = ap.getSubjectsWithPriv(s, g, AccessPrivilege.ADMIN);
- Specified by:
getSubjectsWithPrivin interfaceAccessAdapter- Parameters:
s- Get privileges within this session context.g- Get privileges on this group.priv- Get this privilege.- Returns:
- Set of
Subjectobjects. - Throws:
SchemaException- See Also:
-
getGroupsWhereSubjectHasPriv
public Set<Group> getGroupsWhereSubjectHasPriv(GrouperSession s, Subject subj, Privilege priv) throws SchemaException Get all groups where this subject has this privilege.try { Set isAdmin = ap.getGroupsWhereSubjectHasPriv( s, subj, AccessPrivilege.ADMIN ); } catch (SchemaException eS) { // Invalid priv }- Specified by:
getGroupsWhereSubjectHasPrivin interfaceAccessAdapter- Parameters:
s- Get privileges within this session context.subj- Get privileges for this subject.priv- Get this privilege.- Returns:
- Set of
Groupobjects. - Throws:
SchemaException
-
getGroupsWhereSubjectDoesntHavePrivilege
public Set<Group> getGroupsWhereSubjectDoesntHavePrivilege(GrouperSession grouperSession, String stemId, Stem.Scope scope, Subject subject, Privilege privilege, boolean considerAllSubject, String sqlLikeString) Get all groups where this subject doesnt have this privilege.- Specified by:
getGroupsWhereSubjectDoesntHavePrivilegein interfaceAccessAdapter- Parameters:
grouperSession-stemId-scope-subject-privilege-considerAllSubject-sqlLikeString-- Returns:
- groups
-
getStemsWhereGroupThatSubjectHasPrivilege
public Set<Stem> getStemsWhereGroupThatSubjectHasPrivilege(GrouperSession grouperSession, Subject subject, Privilege privilege) Description copied from interface:AccessAdapterget stems where a group exists where the subject has privilege- Specified by:
getStemsWhereGroupThatSubjectHasPrivilegein interfaceAccessAdapter- Returns:
- the stems
- See Also:
-
getPrivs
Get all privileges held by this subject on this group.Set privs = ap.getPrivs(s, g, subj);
- Specified by:
getPrivsin interfaceAccessAdapter- Parameters:
s- Get privileges within this session context.g- Get privileges on this group.subj- Get privileges for this member.- Returns:
- Set of privileges.
-
grantPriv
public void grantPriv(GrouperSession s, Group g, Subject subj, Privilege priv, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant the privilege to the subject on this group.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 }- Specified by:
grantPrivin interfaceAccessAdapter- Parameters:
s- Grant privilege in this session context.g- Grant privilege on this group.subj- Grant privilege to this subject.priv- Grant this privilege.uuid-- Throws:
GrantPrivilegeExceptionInsufficientPrivilegeExceptionSchemaException
-
hasPriv
public boolean hasPriv(GrouperSession s, Group g, Subject subj, Privilege priv) throws SchemaException Description copied from interface:AccessAdapterCheck whether the subject has this privilege on this group.try { ap.hasPriv(s, g, subject, AccessPrivilege.ADMIN); } catch (SchemaException e) { // Invalid privilege }- Specified by:
hasPrivin interfaceAccessAdapter- Parameters:
s- Check privilege in this session context.g- Check privilege on this group.subj- Check privilege for this subject.priv- Check this privilege.- Returns:
- if has priv
- Throws:
SchemaException- See Also:
-
privilegeCopy
public void privilegeCopy(GrouperSession s, Group g1, Group g2, Privilege priv) throws InsufficientPrivilegeException, GrantPrivilegeException, SchemaException Copies privileges for subjects that have the specified privilege on g1 to g2.- Specified by:
privilegeCopyin interfaceAccessAdapter- Parameters:
s-g1-g2-priv-- Throws:
InsufficientPrivilegeExceptionGrantPrivilegeExceptionSchemaException
-
privilegeCopy
public void privilegeCopy(GrouperSession s, Subject subj1, Subject subj2, Privilege priv) throws InsufficientPrivilegeException, GrantPrivilegeException, SchemaException Copies privileges of type priv on any subject for the given Subject subj1 to the given Subject subj2. For instance, if subj1 has ADMIN privilege to Group x, this method will result with subj2 having ADMIN privilege to Group x.- Specified by:
privilegeCopyin interfaceAccessAdapter- Parameters:
s-subj1-subj2-priv-- Throws:
InsufficientPrivilegeExceptionGrantPrivilegeExceptionSchemaException
-
revokePriv
public void revokePriv(GrouperSession s, Group g, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke this privilege from everyone on this group.try { ap.revokePriv(s, g, AccessPrivilege.ADMIN); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke the privilege } catch (RevokePrivilegeException eRP) { // Unable to revoke the privilege }- Specified by:
revokePrivin interfaceAccessAdapter- Parameters:
s- Revoke privilege in this session context.g- Revoke privilege on this group.priv- Revoke this privilege.- Throws:
InsufficientPrivilegeExceptionRevokePrivilegeExceptionSchemaException
-
revokePriv
public void revokePriv(GrouperSession s, Group g, Subject subj, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke the privilege from the subject on this group.try { ap.revokePriv(s, g, subj, AccessPrivilege.ADMIN); } catch (InsufficientPrivilegeException e0) { // Not privileged to grant the privilege } catch (RevokePrivilegeException e2) { // Unable to revoke the privilege }- Specified by:
revokePrivin interfaceAccessAdapter- Parameters:
s- Revoke privilege in this session context.g- Revoke privilege on this group.subj- Revoke privilege from this subject.priv- Revoke this privilege.- Throws:
InsufficientPrivilegeExceptionRevokePrivilegeExceptionSchemaException
-
revokeAllPrivilegesForSubject
Description copied from interface:AccessAdapterRevoke all access privileges that this subject has. -
retrievePrivileges
public Set<PrivilegeSubjectContainer> retrievePrivileges(GrouperSession grouperSession, Group group, Set<Privilege> privileges, MembershipType membershipType, QueryPaging queryPaging, Set<Member> additionalMembers) Description copied from interface:AccessAdapterget a list of privilege subjects, there are no results with the same subject/privilege combination- Specified by:
retrievePrivilegesin interfaceAccessAdapter- Parameters:
grouperSession- grouper sessiongroup- to search onprivileges- if blank, get allmembershipType- if immediate, effective, or blank for allqueryPaging- if a certain page should be returned based on subjectadditionalMembers- additional members to query that the user is finding or adding- Returns:
- the privilege subject combinations
- See Also:
-
edu.internet2.middleware.grouper.privsAccessAdapter#retrievePrivileges(edu.internet2.middleware.grouper.GrouperSession, Group, java.util.Set, edu.internet2.middleware.grouper.membership.MembershipType, edu.internet2.middleware.grouper.internal.dao.QueryPaging, Set)
-
getGroupsWhereSubjectDoesHavePrivilege
public Set<Group> getGroupsWhereSubjectDoesHavePrivilege(GrouperSession grouperSession, String stemId, Stem.Scope scope, Subject subject, Privilege privilege, boolean considerAllSubject, String sqlLikeString) Get all groups where this subject does have this privilege.- Specified by:
getGroupsWhereSubjectDoesHavePrivilegein interfaceAccessAdapter- Parameters:
grouperSession-stemId-scope-subject-privilege-considerAllSubject-sqlLikeString-- Returns:
- groups
-