Class RoleBasedAuthorizationStrategy.DescriptorImpl

java.lang.Object
hudson.model.Descriptor<AuthorizationStrategy>
com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy.DescriptorImpl
All Implemented Interfaces:
Saveable, Loadable, OnMaster
Enclosing class:
RoleBasedAuthorizationStrategy

public static final class RoleBasedAuthorizationStrategy.DescriptorImpl extends Descriptor<AuthorizationStrategy>
Descriptor used to bind the strategy to the Web forms.
  • Constructor Details

    • DescriptorImpl

      public DescriptorImpl()
  • Method Details

    • getDisplayName

      @NonNull public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<AuthorizationStrategy>
    • doCheckForWhitespace

      public FormValidation doCheckForWhitespace(@QueryParameter String value)
      Checks if the value contains whitespace at begin or end.
      Parameters:
      value - Value to check
      Returns:
      FormValidation
    • doRolesSubmit

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRolesSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
      Called on role management form's submission.
      Throws:
      javax.servlet.ServletException
      IOException
    • doAssignSubmit

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAssignSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
      Called on role assignment form's submission.
      Throws:
      javax.servlet.ServletException
      IOException
    • doTemplatesSubmit

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doTemplatesSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
      Called on role generator form submission.
      Throws:
      javax.servlet.ServletException
      IOException
    • newInstance

      public AuthorizationStrategy newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
      Method called on Jenkins Manage panel submission, and plugin specific forms to create the AuthorizationStrategy object.
      Overrides:
      newInstance in class Descriptor<AuthorizationStrategy>
    • getGroups

      @Nullable public List<PermissionGroup> getGroups(@NonNull String type)
      Get the needed permissions groups.
      Parameters:
      type - Role type
      Returns:
      Groups, which should be displayed for a specific role type. null if an unsupported type is defined.
    • showPermission

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean showPermission(String type, Permission p)
      Used from Jelly.
      Parameters:
      type - Role type
      p - Permission
      Returns:
      true if permission should be shown
    • impliedByList

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public String impliedByList(Permission p)
      Returns a String with the permissions that imply the given permission.
      Parameters:
      p - Permission
      Returns:
      String with implying permission
    • entryFor

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public PermissionEntry entryFor(String type, String sid)
      Create PermissionEntry.
      Parameters:
      type - AuthorizationType
      sid - SID
      Returns:
      PermissionEntry
    • doCheckPattern

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckPattern(@QueryParameter String value)
      Validate the pattern.
      Parameters:
      value - Pattern to validate
      Returns:
      FormValidation object with result
    • doCheckName

      public FormValidation doCheckName(@QueryParameter String value)
      Check the given SID and look it up in the security realm and returns html snippet that will be displayed in the form instead of the plain sid.

      When the name matches an existing user the users full name will be shown, otherwise it will be just the sid. For Existing users and groups, the corresponding icon will be used.

      Parameters:
      value - Name to validate
      Returns:
      FormValidation object
    • hasAmbiguousEntries

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean hasAmbiguousEntries(SortedMap<Role,Set<PermissionEntry>> grantedRoles)