Class RunAsManagerImpl
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean,- RunAsManager
RunAsManager.
 
 Is activated if any ConfigAttribute.getAttribute() is prefixed with
 RUN_AS_. If found, it generates a new RunAsUserToken containing
 the same principal, credentials and granted authorities as the original
 Authentication object, along with SimpleGrantedAuthoritys for each
 RUN_AS_ indicated. The created SimpleGrantedAuthoritys will
 be prefixed with a special prefix indicating that it is a role (default prefix value is
 ROLE_), and then the remainder of the RUN_AS_ keyword. For
 example, RUN_AS_FOO will result in the creation of a granted authority of
 ROLE_RUN_AS_FOO.
 
 The role prefix may be overridden from the default, to match that used elsewhere, for
 example when using an existing role database with another prefix. An empty role prefix
 may also be specified. Note however that there are potential issues with using an empty
 role prefix since different categories of ConfigAttribute can not be properly
 discerned based on the prefix, with possible consequences when performing voting and
 other actions. However, this option may be of some use when using pre-existing role
 names without a prefix, and no ability exists to prefix them with a role prefix on
 reading them in, such as provided for example in
 JdbcDaoImpl.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeprecated.@Nullable AuthenticationbuildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) Deprecated.Returns a replacementAuthenticationobject for the current secure object invocation, ornullif replacement not required.getKey()Deprecated.Deprecated.voidDeprecated.voidsetRolePrefix(String rolePrefix) Deprecated.Allows the default role prefix ofROLE_to be overridden.booleanDeprecated.This implementation supports any type of class, because it does not query the presented secure object.booleansupports(ConfigAttribute attribute) Deprecated.Indicates whether thisRunAsManageris able to process the passedConfigAttribute.
- 
Constructor Details- 
RunAsManagerImplpublic RunAsManagerImpl()Deprecated.
 
- 
- 
Method Details- 
afterPropertiesSetpublic void afterPropertiesSet()Deprecated.- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
- 
buildRunAspublic @Nullable Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) Deprecated.Description copied from interface:RunAsManagerReturns a replacementAuthenticationobject for the current secure object invocation, ornullif replacement not required.- Specified by:
- buildRunAsin interface- RunAsManager
- Parameters:
- authentication- the caller invoking the secure object
- object- the secured object being called
- attributes- the configuration attributes associated with the secure object being invoked
- Returns:
- a replacement object to be used for duration of the secure object
 invocation, or nullif theAuthenticationshould be left as is
 
- 
getKeyDeprecated.
- 
getRolePrefixDeprecated.
- 
setKeyDeprecated.
- 
setRolePrefixDeprecated.Allows the default role prefix ofROLE_to be overridden. May be set to an empty value, although this is usually not desirable.- Parameters:
- rolePrefix- the new prefix
 
- 
supportsDeprecated.Description copied from interface:RunAsManagerIndicates whether thisRunAsManageris able to process the passedConfigAttribute.This allows the AbstractSecurityInterceptorto check every configuration attribute can be consumed by the configuredAccessDecisionManagerand/orRunAsManagerand/orAfterInvocationManager.- Specified by:
- supportsin interface- RunAsManager
- Parameters:
- attribute- a configuration attribute that has been configured against the- AbstractSecurityInterceptor
- Returns:
- trueif this- RunAsManagercan support the passed configuration attribute
 
- 
supportsDeprecated.This implementation supports any type of class, because it does not query the presented secure object.- Specified by:
- supportsin interface- RunAsManager
- Parameters:
- clazz- the secure object
- Returns:
- always true
 
 
-