Class SystemAuthorizationStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<AuthorizeProjectStrategy>
-
- org.jenkinsci.plugins.authorizeproject.AuthorizeProjectStrategy
-
- org.jenkinsci.plugins.authorizeproject.strategy.SystemAuthorizationStrategy
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<AuthorizeProjectStrategy>
public class SystemAuthorizationStrategy extends AuthorizeProjectStrategy
Run builds asACL.SYSTEM
. Using this strategy becomes important whenGlobalQueueItemAuthenticator
is forcing jobs to a user other thanACL.SYSTEM
.- Since:
- 1.2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SystemAuthorizationStrategy.DescriptorImpl
Our descriptor-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SystemAuthorizationStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Authentication
authenticate(Job<?,?> job, Queue.Item item)
Returns theAuthentication
for the build.protected static SystemAuthorizationStrategy
getCurrentStrategy(Job<?,?> job)
ReturnSystemAuthorizationStrategy
configured in a job.SystemAuthorizationStrategy.DescriptorImpl
getDescriptor()
boolean
hasAuthorizationConfigurePermission(AccessControlled context)
Tests if the authorization can be configured by the current user.boolean
hasJobConfigurePermission(AccessControlled context)
Tests if the job can be reconfigured by the current user when this strategy is the configured strategy.-
Methods inherited from class org.jenkinsci.plugins.authorizeproject.AuthorizeProjectStrategy
all, authenticate, checkAuthorizationConfigurePermission, checkJobConfigurePermission, readResolve
-
-
-
-
Method Detail
-
authenticate
public Authentication authenticate(Job<?,?> job, Queue.Item item)
Returns theAuthentication
for the build.- Overrides:
authenticate
in classAuthorizeProjectStrategy
- Parameters:
job
- the project to run.item
- the item in queue, which will be a build.- Returns:
true
if authentication was successful
-
getCurrentStrategy
protected static SystemAuthorizationStrategy getCurrentStrategy(Job<?,?> job)
ReturnSystemAuthorizationStrategy
configured in a job.- Parameters:
job
- theJob
- Returns:
- the
SystemAuthorizationStrategy
ornull
-
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 withJenkins.ADMINISTER
permission skips this check.- Overrides:
hasJobConfigurePermission
in classAuthorizeProjectStrategy
- Parameters:
context
- the context of the job- Returns:
true
if and only if the current user is allowed to reconfigure the specified job.
-
hasAuthorizationConfigurePermission
public boolean hasAuthorizationConfigurePermission(AccessControlled context)
Tests if the authorization can be configured by the current user. Users withJenkins.ADMINISTER
permission skips this check.- Overrides:
hasAuthorizationConfigurePermission
in classAuthorizeProjectStrategy
- Parameters:
context
- the context of the job- Returns:
true
if and only if the current user is allowed to configure this authorization.
-
getDescriptor
public SystemAuthorizationStrategy.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<AuthorizeProjectStrategy>
- Overrides:
getDescriptor
in classAuthorizeProjectStrategy
-
-