Class TriggeringUsersAuthorizationStrategy

All Implemented Interfaces:
ExtensionPoint, Describable<AuthorizeProjectStrategy>

public class TriggeringUsersAuthorizationStrategy extends AuthorizeProjectStrategy
Run builds as a user who triggered the build.
  • Constructor Details

    • TriggeringUsersAuthorizationStrategy

      @DataBoundConstructor public TriggeringUsersAuthorizationStrategy()
      Our constructor.
  • Method Details

    • authenticate

      public org.springframework.security.core.Authentication authenticate(Job<?,?> project, Queue.Item item)
      Returns the Authentication for the build.
      Specified by:
      authenticate in class AuthorizeProjectStrategy
      Parameters:
      project - the project to run.
      item - the item in queue, which will be a build.
      Returns:
      true if authentication was successful
    • hasJobConfigurePermission

      public boolean hasJobConfigurePermission(AccessControlled context)
      Tests if the job can be reconfigured by the current user when this strategy is the configured strategy. Users with Jenkins.ADMINISTER permission skips this check.
      Overrides:
      hasJobConfigurePermission in class AuthorizeProjectStrategy
      Parameters:
      context - the context of the job
      Returns:
      true if and only if the current user is allowed to reconfigure the specified job.