Class RunAsManagerImpl
- java.lang.Object
-
- org.springframework.security.access.intercept.RunAsManagerImpl
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,RunAsManager
@Deprecated public class RunAsManagerImpl extends java.lang.Object implements RunAsManager, org.springframework.beans.factory.InitializingBean
Deprecated.Authentication is now separated from authorization in Spring Security. This class is only used by now-deprecated components. There is not yet an equivalent replacement in Spring Security.Basic concrete implementation of aRunAsManager
.Is activated if any
ConfigAttribute.getAttribute()
is prefixed withRUN_AS_
. If found, it generates a newRunAsUserToken
containing the same principal, credentials and granted authorities as the originalAuthentication
object, along withSimpleGrantedAuthority
s for eachRUN_AS_
indicated. The createdSimpleGrantedAuthority
s will be prefixed with a special prefix indicating that it is a role (default prefix value isROLE_
), and then the remainder of theRUN_AS_
keyword. For example,RUN_AS_FOO
will result in the creation of a granted authority ofROLE_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 inJdbcDaoImpl
.
-
-
Constructor Summary
Constructors Constructor Description RunAsManagerImpl()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterPropertiesSet()
Deprecated.Authentication
buildRunAs(Authentication authentication, java.lang.Object object, java.util.Collection<ConfigAttribute> attributes)
Deprecated.Returns a replacementAuthentication
object for the current secure object invocation, ornull
if replacement not required.java.lang.String
getKey()
Deprecated.java.lang.String
getRolePrefix()
Deprecated.void
setKey(java.lang.String key)
Deprecated.void
setRolePrefix(java.lang.String rolePrefix)
Deprecated.Allows the default role prefix ofROLE_
to be overridden.boolean
supports(java.lang.Class<?> clazz)
Deprecated.This implementation supports any type of class, because it does not query the presented secure object.boolean
supports(ConfigAttribute attribute)
Deprecated.Indicates whether thisRunAsManager
is able to process the passedConfigAttribute
.
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
Deprecated.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
buildRunAs
public Authentication buildRunAs(Authentication authentication, java.lang.Object object, java.util.Collection<ConfigAttribute> attributes)
Deprecated.Description copied from interface:RunAsManager
Returns a replacementAuthentication
object for the current secure object invocation, ornull
if replacement not required.- Specified by:
buildRunAs
in interfaceRunAsManager
- Parameters:
authentication
- the caller invoking the secure objectobject
- the secured object being calledattributes
- 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
null
if theAuthentication
should be left as is
-
getKey
public java.lang.String getKey()
Deprecated.
-
getRolePrefix
public java.lang.String getRolePrefix()
Deprecated.
-
setKey
public void setKey(java.lang.String key)
Deprecated.
-
setRolePrefix
public void setRolePrefix(java.lang.String rolePrefix)
Deprecated.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
-
supports
public boolean supports(ConfigAttribute attribute)
Deprecated.Description copied from interface:RunAsManager
Indicates whether thisRunAsManager
is able to process the passedConfigAttribute
.This allows the
AbstractSecurityInterceptor
to check every configuration attribute can be consumed by the configuredAccessDecisionManager
and/orRunAsManager
and/orAfterInvocationManager
.- Specified by:
supports
in interfaceRunAsManager
- Parameters:
attribute
- a configuration attribute that has been configured against theAbstractSecurityInterceptor
- Returns:
true
if thisRunAsManager
can support the passed configuration attribute
-
supports
public boolean supports(java.lang.Class<?> clazz)
Deprecated.This implementation supports any type of class, because it does not query the presented secure object.- Specified by:
supports
in interfaceRunAsManager
- Parameters:
clazz
- the secure object- Returns:
- always
true
-
-