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
    • doTemplatesSubmit

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

      public AuthorizationStrategy newInstance(org.kohsuke.stapler.StaplerRequest2 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
    • 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
    • doCheckSidName

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckSidName(@QueryParameter String value, @QueryParameter String type)
      Looks a sid up in the security realm and returns an html snippet, with icon and resolved display name, that the Assign Roles dialog shows below the name field.

      Missing sids render struck through but still validate OK: an assignment for a sid the realm cannot resolve (e.g. a group from an external directory) is legal.

      Parameters:
      value - the sid to look up
      type - USER or GROUP
      Returns:
      FormValidation whose message is the html snippet