Class RoleDefinition

java.lang.Object
org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition
All Implemented Interfaces:
Comparable<RoleDefinition>

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class RoleDefinition extends Object implements Comparable<RoleDefinition>
Role definition. Used for custom formatting
Since:
2.11
Author:
Oleg Nenashev
  • Field Details

    • LOGGER

      public static final Logger LOGGER
  • Constructor Details

    • RoleDefinition

      @DataBoundConstructor public RoleDefinition(String name, String description, String pattern, Collection<String> permissions)
      Creates a RoleDefinition.
      Parameters:
      name - Role name
      description - Role description
      pattern - Role pattern
      permissions - Assigned permissions
  • Method Details

    • setAssignments

      @DataBoundSetter @Deprecated public void setAssignments(Collection<String> assignments)
      Deprecated.
      Legacy setter for string based assignments.
      Parameters:
      assignments - The assigned sids
    • setEntries

      @DataBoundSetter public void setEntries(Collection<RoleDefinition.RoleDefinitionEntry> entries)
      Setter for entries.
      Parameters:
      entries - The permission entries
    • getRole

      public final Role getRole()
      Returns the corresponding Role object.
      Returns:
      Role
    • getName

      @NonNull public String getName()
    • getDescription

      public String getDescription()
    • getPattern

      public String getPattern()
    • getTemplateName

      public String getTemplateName()
    • getFolders

      @CheckForNull public SortedSet<String> getFolders()
      Full names of the folders an item role applies to, instead of getPattern().
      Returns:
      the folders, or null for a pattern-based role. An empty set means folders was given but held no usable entry, which the configurator rejects rather than widening the role to every item.
    • setFolders

      @DataBoundSetter public void setFolders(@CheckForNull Collection<String> folders)
      Scopes an item role to folders instead of a pattern: the role then applies to each folder and everything nested in it. Setting both folders and pattern is a configuration error.
      Parameters:
      folders - Full names of the folders
    • setTemplateName

      @DataBoundSetter public void setTemplateName(String templateName)
    • getPermissions

      public Set<String> getPermissions()
    • getAssignments

      public Collection<String> getAssignments()
      Deprecated, always returns null.
      Returns:
      null
    • getEntries

    • compareTo

      public int compareTo(@NonNull RoleDefinition o)
      Specified by:
      compareTo in interface Comparable<RoleDefinition>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object