Class PrivilegeGroupInheritanceSave

java.lang.Object
edu.internet2.middleware.grouper.PrivilegeGroupInheritanceSave

public class PrivilegeGroupInheritanceSave extends Object

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 Details

    • PrivilegeGroupInheritanceSave

      public PrivilegeGroupInheritanceSave()
  • Method Details

    • main

      public static void main(String[] args)
      Parameters:
      args -
    • assignAttributeAssignId

      public PrivilegeGroupInheritanceSave assignAttributeAssignId(String theAttributeAssignId)
      rule attribute assign id to delete
      Parameters:
      theAttributeAssignId -
      Returns:
      this for chaining
    • assignAttributeAssign

      public PrivilegeGroupInheritanceSave assignAttributeAssign(AttributeAssign theAttributeAssign)
      rule attribute assign to delete
      Parameters:
      theAttributeAssignId -
      Returns:
      this for chaining
    • addField

      public PrivilegeGroupInheritanceSave addField(Field theField)
      field of privilege
      Parameters:
      theFieldId -
      Returns:
      this for chaining
    • addFieldId

      public PrivilegeGroupInheritanceSave addFieldId(String theFieldId)
      field of privilege
      Parameters:
      theFieldId -
      Returns:
      this for chaining
    • addFieldName

      public PrivilegeGroupInheritanceSave addFieldName(String theFieldName)
      field of privilege (could be privilege name too)
      Parameters:
      theFieldName -
      Returns:
      this for chaining
    • addPrivilege

      public PrivilegeGroupInheritanceSave addPrivilege(Privilege privilege)
      add privilege
      Parameters:
      theFieldName -
      Returns:
      this for chaining
    • addPrivilegeName

      public PrivilegeGroupInheritanceSave addPrivilegeName(String thePrivilegeName)
      field of privilege (could be privilege name too)
      Parameters:
      thePrivilegeName -
      Returns:
      this for chaining
    • assignMember

      public PrivilegeGroupInheritanceSave assignMember(Member theMember)
      member to add
      Parameters:
      member -
      Returns:
      this for chaining
    • assignMemberId

      public PrivilegeGroupInheritanceSave assignMemberId(String theMemberId)
      member id to add
      Parameters:
      theMemberId -
      Returns:
      this for chaining
    • assignSaveMode

      public PrivilegeGroupInheritanceSave assignSaveMode(SaveMode theSaveMode)
      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

      public PrivilegeGroupInheritanceSave assignSubject(Subject theSubject)
      subject to add
      Parameters:
      theSubject -
      Returns:
      this for chaining
    • assignSubjectId

      public PrivilegeGroupInheritanceSave assignSubjectId(String theSubjectId)
      subject id to add, mutually exclusive and preferable to subject identifier
      Parameters:
      theSubjectId -
      Returns:
      this for chaining
    • assignSubjectIdentifier

      public PrivilegeGroupInheritanceSave assignSubjectIdentifier(String theSubjectIdentifier)
      subject identifier to add, mutually exclusive and not preferable to subject id
      Parameters:
      thesubjectIdentifier -
      Returns:
      this for chaining
    • assignSubjectSourceId

      public PrivilegeGroupInheritanceSave assignSubjectSourceId(String theSubjectSourceId)
      subject source id to add
      Parameters:
      theSubjectSourceId -
      Returns:
      this for chaining
    • getSaveResultType

      public SaveResultType 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

      public PrivilegeGroupInheritanceSave assignRunAsRoot(boolean runAsRoot)
      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

      public PrivilegeGroupInheritanceSave assignStem(Stem theStem)
      assign a stem
      Parameters:
      theStem -
      Returns:
      this for chaining
    • assignStemScope

      public PrivilegeGroupInheritanceSave assignStemScope(Stem.Scope theScope)
      assign a stem scope, default to SUB
      Parameters:
      theStem -
      Returns:
      this for chaining
    • assignStemScopeName

      public PrivilegeGroupInheritanceSave assignStemScopeName(String theScope)
      assign a stemscope, default to SUB
      Parameters:
      theStem -
      Returns:
      this for chaining
    • assignStemId

      public PrivilegeGroupInheritanceSave assignStemId(String theStemId)
      stem id to add to, mutually exclusive with stem name
      Parameters:
      theStemId -
      Returns:
      this for chaining
    • assignStemName

      public PrivilegeGroupInheritanceSave assignStemName(String theStemName)
      stem name to add to, mutually exclusive with stem id
      Parameters:
      theStemName -
      Returns:
      this for chaining