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.Authenticationauthenticate(Job<?, ?> project, Queue.Item item) Returns theAuthenticationfor the build.final voidChecks that the authorization can be configured by the current user.final voidChecks that the job can be reconfigured by the current user when this strategy is the configured strategy.booleanTests if the authorization can be configured by the current user.booleanTests if the job can be reconfigured by the current user when this strategy is the configured strategy.protected ObjectIf 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 theAuthenticationfor the build.- Parameters:
project- the project to run.item- the item in queue, which will be a build.- Returns:
trueif authentication was successful
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<AuthorizeProjectStrategy>- Overrides:
getDescriptorin 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.ADMINISTERpermission skips this check.- Parameters:
context- the context of the job- Returns:
trueif 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.ADMINISTERpermission skips this check.- Parameters:
context- the context of the job- Returns:
trueif 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:
-