org.jenkinsci.plugins.authorizeproject.strategy
Class SpecificUsersAuthorizationStrategy

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<AuthorizeProjectStrategy>
      extended by org.jenkinsci.plugins.authorizeproject.AuthorizeProjectStrategy
          extended by org.jenkinsci.plugins.authorizeproject.strategy.SpecificUsersAuthorizationStrategy
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<AuthorizeProjectStrategy>

public class SpecificUsersAuthorizationStrategy
extends AuthorizeProjectStrategy

Run builds as a user specified in project configuration pages.


Nested Class Summary
static class SpecificUsersAuthorizationStrategy.DescriptorImpl
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
SpecificUsersAuthorizationStrategy(String userid, boolean noNeedReauthentication)
          No DataBoundConstructor for requiring to pass the authentication.
 
Method Summary
 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.AbstractProject<?,?> project)
          Deprecated. 
protected static SpecificUsersAuthorizationStrategy getCurrentStrategy(hudson.model.Job<?,?> project)
          Return SpecificUsersAuthorizationStrategy configured in a project.
 String getUserid()
           
protected static boolean isAuthenticateionRequired(SpecificUsersAuthorizationStrategy newStrategy, SpecificUsersAuthorizationStrategy currentStrategy)
          Returns whether authentication is required to update the configuration to newStrategy.
 boolean isNoNeedReauthentication()
           
 
Methods inherited from class org.jenkinsci.plugins.authorizeproject.AuthorizeProjectStrategy
all, authenticate
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecificUsersAuthorizationStrategy

public SpecificUsersAuthorizationStrategy(String userid,
                                          boolean noNeedReauthentication)
No DataBoundConstructor for requiring to pass the authentication. authentication is performed in SpecificUsersAuthorizationStrategy.DescriptorImpl.newInstance(StaplerRequest, JSONObject)

Method Detail

getUserid

public String getUserid()
Returns:
id of the user to run builds as.

isNoNeedReauthentication

public boolean isNoNeedReauthentication()
Returns:
if true, entering password is not required when the userid is not changed.

authenticate

public org.acegisecurity.Authentication authenticate(hudson.model.Job<?,?> project,
                                                     hudson.model.Queue.Item item)
Run builds as a specified user. If the user is invalid, run as anonymous.

Overrides:
authenticate in class AuthorizeProjectStrategy
Parameters:
project -
item -
Returns:
See Also:
AuthorizeProjectStrategy.authenticate(hudson.model.Job, hudson.model.Queue.Item)

isAuthenticateionRequired

protected static boolean isAuthenticateionRequired(SpecificUsersAuthorizationStrategy newStrategy,
                                                   SpecificUsersAuthorizationStrategy currentStrategy)
Returns whether authentication is required to update the configuration to newStrategy.

Parameters:
newStrategy - strategy to be configured.
currentStrategy - strategy now configured.
Returns:
whether authentication is required.

getCurrentStrategy

protected static SpecificUsersAuthorizationStrategy getCurrentStrategy(hudson.model.Job<?,?> project)
Return SpecificUsersAuthorizationStrategy configured in a project.

Parameters:
project -
Returns:

getCurrentStrategy

@Deprecated
protected static SpecificUsersAuthorizationStrategy getCurrentStrategy(hudson.model.AbstractProject<?,?> project)
Deprecated. 



Copyright © 2004-2015. All Rights Reserved.