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>
Run builds as
ACL.SYSTEM2
. Using this strategy becomes important when
GlobalQueueItemAuthenticator
is forcing jobs to a user other than ACL.SYSTEM2
.- Since:
- 1.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Our descriptorNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
authenticate
(Job<?, ?> job, Queue.Item item) Returns theAuthentication
for the build.protected static SystemAuthorizationStrategy
getCurrentStrategy
(Job<?, ?> job) ReturnSystemAuthorizationStrategy
configured in a job.boolean
Tests if the authorization can be configured by the current user.boolean
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, checkAuthorizationConfigurePermission, checkJobConfigurePermission, readResolve
-
Constructor Details
-
SystemAuthorizationStrategy
@DataBoundConstructor public SystemAuthorizationStrategy()
-
-
Method Details
-
authenticate
Returns theAuthentication
for the build.- Specified by:
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
ReturnSystemAuthorizationStrategy
configured in a job.- Parameters:
job
- theJob
- Returns:
- the
SystemAuthorizationStrategy
ornull
-
hasJobConfigurePermission
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
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
- Specified by:
getDescriptor
in interfaceDescribable<AuthorizeProjectStrategy>
- Overrides:
getDescriptor
in classAuthorizeProjectStrategy
-