com.xebialabs.deployit.security
Class SecurityTemplate

java.lang.Object
  extended by com.xebialabs.deployit.security.SecurityTemplate

public class SecurityTemplate
extends java.lang.Object


Constructor Summary
SecurityTemplate()
           
 
Method Summary
static
<T> T
executeAs(org.springframework.security.core.Authentication credentials, SecurityCallback<T> callback)
           
static
<T> T
executeAs(java.lang.String username, java.lang.String password, SecurityCallback<T> callback)
           
static
<T> T
executeAsAdmin(SecurityCallback<T> callback)
           
static void restoreAuthentication(org.springframework.security.core.Authentication origAuthentication)
           
static org.springframework.security.core.Authentication setAuthentication(org.springframework.security.core.Authentication authentication)
           
static org.springframework.security.core.Authentication setCredentials(java.lang.String username, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityTemplate

public SecurityTemplate()
Method Detail

executeAsAdmin

public static <T> T executeAsAdmin(SecurityCallback<T> callback)

executeAs

public static <T> T executeAs(org.springframework.security.core.Authentication credentials,
                              SecurityCallback<T> callback)

executeAs

public static <T> T executeAs(java.lang.String username,
                              java.lang.String password,
                              SecurityCallback<T> callback)

setCredentials

public static org.springframework.security.core.Authentication setCredentials(java.lang.String username,
                                                                              java.lang.String password)

setAuthentication

public static org.springframework.security.core.Authentication setAuthentication(org.springframework.security.core.Authentication authentication)

restoreAuthentication

public static void restoreAuthentication(org.springframework.security.core.Authentication origAuthentication)