Class AuthorizeProjectStrategy
java.lang.Object
hudson.model.AbstractDescribableImpl<AuthorizeProjectStrategy>
org.jenkinsci.plugins.authorizeproject.AuthorizeProjectStrategy
- All Implemented Interfaces:
ExtensionPoint
,Describable<AuthorizeProjectStrategy>
- Direct Known Subclasses:
AnonymousAuthorizationStrategy
,SpecificUsersAuthorizationStrategy
,SystemAuthorizationStrategy
,TriggeringUsersAuthorizationStrategy
public abstract class AuthorizeProjectStrategy
extends AbstractDescribableImpl<AuthorizeProjectStrategy>
implements ExtensionPoint
Extension point to define a new strategy to authorize builds configured in project configuration pages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()
abstract org.springframework.security.core.Authentication
authenticate
(Job<?, ?> project, Queue.Item item) Returns theAuthentication
for the build.final void
Checks that the authorization can be configured by the current user.final void
Checks that the job can be reconfigured by the current user when this strategy is the configured strategy.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.protected Object
If we are being deserialized outside of loading the initial jobs (or reloading) then we need to cross check the strategy permissions to defend against somebody trying to push a configuration relating to a user other than themselves.
-
Constructor Details
-
AuthorizeProjectStrategy
public AuthorizeProjectStrategy()
-
-
Method Details
-
all
public static DescriptorExtensionList<AuthorizeProjectStrategy,Descriptor<AuthorizeProjectStrategy>> all()- Returns:
- all the registered
AuthorizeProjectStrategy
.
-
authenticate
public abstract org.springframework.security.core.Authentication authenticate(Job<?, ?> project, Queue.Item item) Returns theAuthentication
for the build.- Parameters:
project
- the project to run.item
- the item in queue, which will be a build.- Returns:
true
if authentication was successful
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<AuthorizeProjectStrategy>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<AuthorizeProjectStrategy>
-
checkJobConfigurePermission
Checks that the job can be reconfigured by the current user when this strategy is the configured strategy.- Parameters:
context
- the context of the job- Throws:
org.springframework.security.access.AccessDeniedException
- if the current user is not allowed to reconfigure the specified job- Since:
- 1.3.0
-
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.- Parameters:
context
- the context of the job- Returns:
true
if and only if the current user is allowed to reconfigure the specified job.- Since:
- 1.3.0
-
checkAuthorizationConfigurePermission
Checks that the authorization can be configured by the current user.- Parameters:
context
- the context of the job- Throws:
org.springframework.security.access.AccessDeniedException
- if the current user is not allowed to configure this authorization- Since:
- 1.3.0
-
hasAuthorizationConfigurePermission
Tests if the authorization can be configured by the current user. Users withJenkins.ADMINISTER
permission skips this check.- Parameters:
context
- the context of the job- Returns:
true
if and only if the current user is allowed to configure this authorization.- Since:
- 1.3.0
-
readResolve
If we are being deserialized outside of loading the initial jobs (or reloading) then we need to cross check the strategy permissions to defend against somebody trying to push a configuration relating to a user other than themselves.- Returns:
this
- Throws:
ObjectStreamException
- if the object cannot be deserialized.- See Also:
-