Class GrantRequestLinks

java.lang.Object
io.jenkins.plugins.batchcontrol.ui.GrantRequestLinks

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class GrantRequestLinks extends Object
Links to the new grant request form on the Grants screen, prefilled for one item and one action (U-01 convention: new?scopeFullName=&actions=, D-66; D-71: a window names exactly one item, so there is no scope type). Used by refusal pages (a change or a move that needs a permission window).

Read-only. The item is resolved as the viewer, so an item the viewer cannot see yields no link, and the Grants screen resolves the name again before it prefills anything. No link is offered for an action that cannot apply to the item (applies(hudson.model.Item, io.jenkins.plugins.batchcontrol.model.GrantAction)), because the request would be refused at submission.

  • Method Details

    • canRequest

      public static boolean canRequest()
      Whether the current user may open the Grants screen and submit a grant request.
    • url

      @CheckForNull public static String url(@CheckForNull String fullName, @CheckForNull String action)
      Root-relative URL of the prefilled form, or null when the item is not visible to the viewer, cannot be named by a window (the Jenkins root, a sub-item of a job), the action is not one a window can carry, or it cannot apply to the item (D-71).
      Parameters:
      fullName - full name of the job or folder the window would name; for CREATE, the folder the new item is to be created in
      action - a GrantAction name (CREATE, CONFIGURE, DELETE)
    • applies

      public static boolean applies(@CheckForNull Item item, GrantAction action)
      D-71: whether a permission window carrying action can name item: it must be a top-level item (a job or a folder of any kind); CREATE applies only to a regular folder (GrantScope.createAppliesTo(hudson.model.Item)) and DELETE only to a job (GrantScope.deleteAppliesTo(hudson.model.Item)). The service refuses the others at submission.