Class PrivilegeStemInheritanceSave

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

public class PrivilegeStemInheritanceSave extends Object

Use this class to add/edit/delete privileges on folders inside a folder for a subject

Sample call

 SaveResultType saveResultType = new PrivilegeStemInheritanceSave()
      .assignStem(stem)
      .assignStemScope(Scope.SUB)
      .assignSubject(subject)
      .addPrivilege(NamingPrivilege.STEM_ADMIN)
      .save();
 System.out.println(saveResultType); // INSERT, DELETE, NO_CHANGE, or UPDATE
 

Sample call to delete privileges on folders inside a folder for a subject

 new PrivilegeStemInheritanceSave()
    .assignStem(stem)
    .assignStemScope(Scope.SUB)
    .assignSubject(subject)
    .assignSaveMode(SaveMode.DELETE)
    .save();
 

  • Constructor Details

    • PrivilegeStemInheritanceSave

      public PrivilegeStemInheritanceSave()
  • Method Details

    • main

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

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

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

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

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

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

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

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

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

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

      public PrivilegeStemInheritanceSave 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 PrivilegeStemInheritanceSave assignSubject(Subject theSubject)
      subject to add
      Parameters:
      theSubject -
      Returns:
      this for chaining
    • assignSubjectId

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

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

      public PrivilegeStemInheritanceSave 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 PrivilegeStemInheritanceSave assignNameMatchesSqlLikeString(String theNameMatchesSqlLikeString)
      only do this for certain like strings
      Parameters:
      theNameMatchesSqlLikeString -
      Returns:
      this for chaining
    • assignRunAsRoot

      public PrivilegeStemInheritanceSave 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 stems under a stem for a subject
       
      Returns:
      save result type (INSERT, UPDATE, DELETE, NO_CHANGE)
      Throws:
      InsufficientPrivilegeException
      GroupNotFoundException
    • assignStem

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

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

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

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

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