'Where is hudson.model.Run.Replay permission object defined?

Jenkins allows granting members (users and groups) Run.Replay (Run → Replay) permission by using UI:

Configure Permissions

Unfortunately, Run.Replay permission it is not defined in hudson.model.Run class. All other permissions are available:

  • DeleteRun.DELETE
  • UpdateRun.UPDATE

Where is defined the hudson.security.Permission object which represents Run.Replay permission?



Solution 1:[1]

The permission is introduced by the Pipeline: Groovy plugin. It is defined in the org.jenkinsci.plugins.workflow.cps.replay.ReplayAction class:

/**
 * Attached to a {@link Run} when it could be replayed with script edits.
 */
@SuppressWarnings("rawtypes") // on Run
public class ReplayAction implements Action {

    [...]

    public static final Permission REPLAY = new Permission(Run.PERMISSIONS, "Replay", Messages._Replay_permission_description(), Item.CONFIGURE, PermissionScope.RUN);

Link to the class located in the 2.78 version: https://github.com/jenkinsci/workflow-cps-plugin/blob/workflow-cps-2.78/src/main/java/org/jenkinsci/plugins/workflow/cps/replay/ReplayAction.java#L360

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1