public class SpecificUsersAuthorizationStrategy extends AuthorizeProjectStrategy
| Modifier and Type | Class and Description |
|---|---|
static class |
SpecificUsersAuthorizationStrategy.DescriptorImpl
Our descriptor.
|
| Constructor and Description |
|---|
SpecificUsersAuthorizationStrategy(String userid) |
SpecificUsersAuthorizationStrategy(String userid,
boolean useApitoken,
String apitoken,
String password)
No
DataBoundConstructor for requiring to pass the authentication. |
| Modifier and Type | Method and Description |
|---|---|
org.acegisecurity.Authentication |
authenticate(hudson.model.Job<?,?> project,
hudson.model.Queue.Item item)
Run builds as a specified user.
|
protected static SpecificUsersAuthorizationStrategy |
getCurrentStrategy(hudson.model.Job<?,?> project)
Return
SpecificUsersAuthorizationStrategy configured in a project. |
SpecificUsersAuthorizationStrategy.DescriptorImpl |
getDescriptor() |
String |
getUserid() |
boolean |
hasAuthorizationConfigurePermission(hudson.security.AccessControlled context)
Tests if the authorization can be configured by the current user.
|
boolean |
hasJobConfigurePermission(hudson.security.AccessControlled context)
Tests if the job can be reconfigured by the current user when this strategy is the configured strategy.
|
protected static boolean |
isAuthenticationRequired(String userId) |
boolean |
isDontRestrictJobConfiguration() |
protected Object |
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.
|
void |
setDontRestrictJobConfiguration(boolean dontRestrictPermission) |
all, authenticate, checkAuthorizationConfigurePermission, checkJobConfigurePermissionpublic SpecificUsersAuthorizationStrategy(String userid)
@DataBoundConstructor public SpecificUsersAuthorizationStrategy(String userid, boolean useApitoken, String apitoken, String password) throws org.acegisecurity.AccessDeniedException
DataBoundConstructor for requiring to pass the authentication.
authentication is performed in Descriptor.newInstance(StaplerRequest, JSONObject)org.acegisecurity.AccessDeniedExceptionpublic String getUserid()
public boolean isDontRestrictJobConfiguration()
hasJobConfigurePermission(AccessControlled)@DataBoundSetter public void setDontRestrictJobConfiguration(boolean dontRestrictPermission)
dontRestrictPermission - whether not to restrict job configurationhasJobConfigurePermission(AccessControlled)protected static boolean isAuthenticationRequired(String userId)
public SpecificUsersAuthorizationStrategy.DescriptorImpl getDescriptor()
AuthorizeProjectStrategygetDescriptor in interface hudson.model.Describable<AuthorizeProjectStrategy>getDescriptor in class AuthorizeProjectStrategypublic org.acegisecurity.Authentication authenticate(hudson.model.Job<?,?> project,
hudson.model.Queue.Item item)
authenticate in class AuthorizeProjectStrategyproject - item - AuthorizeProjectStrategy.authenticate(hudson.model.Job, hudson.model.Queue.Item)public boolean hasJobConfigurePermission(hudson.security.AccessControlled context)
Jenkins.ADMINISTER permission skips this check.hasJobConfigurePermission in class AuthorizeProjectStrategycontext - the context of the jobtrue if and only if the current user is allowed to reconfigure the specified job.public boolean hasAuthorizationConfigurePermission(hudson.security.AccessControlled context)
Jenkins.ADMINISTER permission skips this check.hasAuthorizationConfigurePermission in class AuthorizeProjectStrategycontext - the context of the jobtrue if and only if the current user is allowed to configure this authorization.protected static SpecificUsersAuthorizationStrategy getCurrentStrategy(hudson.model.Job<?,?> project)
SpecificUsersAuthorizationStrategy configured in a project.project - protected Object readResolve() throws ObjectStreamException
readResolve in class AuthorizeProjectStrategythisObjectStreamException - if the object cannot be deserialized.AuthorizeProjectProperty.setStrategyCritical()Copyright © 2016–2017. All rights reserved.