Package edu.internet2.middleware.grouper
Class PrivilegeGroupInheritanceSave
java.lang.Object
edu.internet2.middleware.grouper.PrivilegeGroupInheritanceSave
Use this class to add/edit/delete privileges on groups inside a folder for a subject
Sample call
SaveResultType saveResultType = new PrivilegeGroupInheritanceSave() .assignStem(stem) .assignStemScope(Scope.SUB) .assignSubject(subject) .addPrivilege(AccessPrivilege.ADMIN) .addPrivilege(AccessPrivilege.OPTIN) .save(); System.out.println(saveResultType); // INSERT, DELETE, NO_CHANGE, or UPDATE
Sample call to delete privileges on groups inside a folder for a subject
new PrivilegeGroupInheritanceSave() .assignStem(stem) .assignStemScope(Scope.SUB) .assignSubject(subject) .assignSaveMode(SaveMode.DELETE) .save();
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfield of privilegeaddFieldId
(String theFieldId) field of privilegeaddFieldName
(String theFieldName) field of privilege (could be privilege name too)addPrivilege
(Privilege privilege) add privilegeaddPrivilegeName
(String thePrivilegeName) field of privilege (could be privilege name too)assignAttributeAssign
(AttributeAssign theAttributeAssign) rule attribute assign to deleteassignAttributeAssignId
(String theAttributeAssignId) rule attribute assign id to deleteassignMember
(Member theMember) member to addassignMemberId
(String theMemberId) member id to addassignNameMatchesSqlLikeString
(String theNameMatchesSqlLikeString) only do this for certain like stringsassignRunAsRoot
(boolean runAsRoot) set this to true to run as a root sessionassignSaveMode
(SaveMode theSaveMode) save mode.assignStem
(Stem theStem) assign a stemassignStemId
(String theStemId) stem id to add to, mutually exclusive with stem nameassignStemName
(String theStemName) stem name to add to, mutually exclusive with stem idassignStemScope
(Stem.Scope theScope) assign a stem scope, default to SUBassignStemScopeName
(String theScope) assign a stemscope, default to SUBassignSubject
(Subject theSubject) subject to addassignSubjectId
(String theSubjectId) subject id to add, mutually exclusive and preferable to subject identifierassignSubjectIdentifier
(String theSubjectIdentifier) subject identifier to add, mutually exclusive and not preferable to subject idassignSubjectSourceId
(String theSubjectSourceId) subject source id to addget the save typestatic void
save()
create or update or delete privileges on all groups under a stem for a subject
-
Constructor Details
-
PrivilegeGroupInheritanceSave
public PrivilegeGroupInheritanceSave()
-
-
Method Details
-
main
- Parameters:
args
-
-
assignAttributeAssignId
rule attribute assign id to delete- Parameters:
theAttributeAssignId
-- Returns:
- this for chaining
-
assignAttributeAssign
rule attribute assign to delete- Parameters:
theAttributeAssignId
-- Returns:
- this for chaining
-
addField
field of privilege- Parameters:
theFieldId
-- Returns:
- this for chaining
-
addFieldId
field of privilege- Parameters:
theFieldId
-- Returns:
- this for chaining
-
addFieldName
field of privilege (could be privilege name too)- Parameters:
theFieldName
-- Returns:
- this for chaining
-
addPrivilege
add privilege- Parameters:
theFieldName
-- Returns:
- this for chaining
-
addPrivilegeName
field of privilege (could be privilege name too)- Parameters:
thePrivilegeName
-- Returns:
- this for chaining
-
assignMember
member to add- Parameters:
member
-- Returns:
- this for chaining
-
assignMemberId
member id to add- Parameters:
theMemberId
-- Returns:
- this for chaining
-
assignSaveMode
save mode. Delete is remove privs. If you dont specify privs it will remove all. If you dont specify stem scope it will remove all stem scopes Insert is add privs (error if they are already there). Update is replace existing privs with new list. Insert or update just adds some, and if there no error- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
assignSubject
subject to add- Parameters:
theSubject
-- Returns:
- this for chaining
-
assignSubjectId
subject id to add, mutually exclusive and preferable to subject identifier- Parameters:
theSubjectId
-- Returns:
- this for chaining
-
assignSubjectIdentifier
subject identifier to add, mutually exclusive and not preferable to subject id- Parameters:
thesubjectIdentifier
-- Returns:
- this for chaining
-
assignSubjectSourceId
subject source id to add- Parameters:
theSubjectSourceId
-- Returns:
- this for chaining
-
getSaveResultType
get the save type- Returns:
- save type
-
assignNameMatchesSqlLikeString
public PrivilegeGroupInheritanceSave assignNameMatchesSqlLikeString(String theNameMatchesSqlLikeString) only do this for certain like strings- Parameters:
theNameMatchesSqlLikeString
-- Returns:
- this for chaining
-
assignRunAsRoot
set this to true to run as a root session- Parameters:
runAsRoot
-- Returns:
-
save
create or update or delete privileges on all groups under a stem for a subject
- Returns:
- save result type (INSERT, UPDATE, DELETE, NO_CHANGE)
- Throws:
InsufficientPrivilegeException
GroupNotFoundException
-
assignStem
assign a stem- Parameters:
theStem
-- Returns:
- this for chaining
-
assignStemScope
assign a stem scope, default to SUB- Parameters:
theStem
-- Returns:
- this for chaining
-
assignStemScopeName
assign a stemscope, default to SUB- Parameters:
theStem
-- Returns:
- this for chaining
-
assignStemId
stem id to add to, mutually exclusive with stem name- Parameters:
theStemId
-- Returns:
- this for chaining
-
assignStemName
stem name to add to, mutually exclusive with stem id- Parameters:
theStemName
-- Returns:
- this for chaining
-