Class GrantScope

java.lang.Object
io.jenkins.plugins.batchcontrol.model.GrantScope

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class GrantScope extends Object
Target of a grant request / grant: exactly one item, a job or a folder of any kind (D-71, replaces the JOB, FOLDER and FOLDER_ONLY scopes of D-65). A window confers nothing on any other item, including the items inside a folder.
  • CONFIGURE (and EXTENDED_READ through the impliedBy walk, P-11) is answered on the item's own ACL: includes(String).
  • CREATE is checked by core on the ACL of the group the new item is created in, so a CREATE window, which can only exist on a regular folder (createAppliesTo(Item)), admits creation directly inside that folder only: includes(String) of the group.
  • DELETE can only exist on a job (deleteAppliesTo(Item)): deleting an item group that is not a job deletes its children as SYSTEM without checking them.
  • D-35c: the items its holder created through a CREATE window are matched by parent, isParentOf(String), not by name prefix.

An empty full name (the Jenkins root) is not a valid scope: it is rejected when a grant request is created and again when it is approved, and includes(String) matches nothing for it. There is no root-scope / instance-wide grant.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Scope kind.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    D-71: whether a window's CREATE can apply to item: a modifiable item group that is neither a job nor a computed folder (a regular folder; not a multibranch project or an organization folder, whose children are created by indexing).
    static boolean
    D-71: whether a window's DELETE can apply to item: a Job only, including multi-configuration and Maven projects, whose sub-items are part of the job.
    boolean
     
     
     
    int
     
    boolean
    includes(String itemFullName)
    Whether the given item full name is the scope item: an exact full-name match (D-71).
    boolean
    isParentOf(String itemFullName)
    D-35c (as amended by D-71): whether the scope item is the parent of itemFullName, i.e.
    static GrantScope
    item(String fullName)
    The scope naming exactly the item fullName (D-71).
    static String
    parentOf(String itemFullName)
    The full name of the group itemFullName lies in ("" for a root item).
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • item

      public static GrantScope item(String fullName)
      The scope naming exactly the item fullName (D-71).
    • getType

      public GrantScope.Type getType()
    • getFullName

      public String getFullName()
    • includes

      public boolean includes(String itemFullName)
      Whether the given item full name is the scope item: an exact full-name match (D-71). An empty scope name matches nothing at all — see below.
    • isParentOf

      public boolean isParentOf(@CheckForNull String itemFullName)
      D-35c (as amended by D-71): whether the scope item is the parent of itemFullName, i.e. the item lies directly inside the scope folder (f/x, never f/sub/x and never f itself).
    • parentOf

      public static String parentOf(String itemFullName)
      The full name of the group itemFullName lies in ("" for a root item).
    • createAppliesTo

      public static boolean createAppliesTo(@CheckForNull Item item)
      D-71: whether a window's CREATE can apply to item: a modifiable item group that is neither a job nor a computed folder (a regular folder; not a multibranch project or an organization folder, whose children are created by indexing).
    • deleteAppliesTo

      public static boolean deleteAppliesTo(@CheckForNull Item item)
      D-71: whether a window's DELETE can apply to item: a Job only, including multi-configuration and Maven projects, whose sub-items are part of the job. Never an item group that is not a job (a folder, a multibranch project, an organization folder): core's AbstractItem.delete() deletes such a group's children as SYSTEM without checking them.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object