クラス AbstractSecurityExpressionHandler<T>
java.lang.ObjectSE
org.springframework.security.access.expression.AbstractSecurityExpressionHandler<T>
- 実装されているすべてのインターフェース:
org.springframework.aop.framework.AopInfrastructureBean、org.springframework.beans.factory.Aware、org.springframework.context.ApplicationContextAware、SecurityExpressionHandler<T>
- 既知の直属サブクラス
DefaultHttpSecurityExpressionHandler、DefaultMessageSecurityExpressionHandler、DefaultMethodSecurityExpressionHandler、DefaultWebSecurityExpressionHandler
public abstract class AbstractSecurityExpressionHandler<T>
extends ObjectSE
implements SecurityExpressionHandler<T>, org.springframework.context.ApplicationContextAware
基本的な式オブジェクトの実装からセキュリティ式を評価するための Spring Security の要件を分離するファサードの基本実装。
- 導入:
- 3.1
コンストラクターの概要
コンストラクター方法の概要
修飾子と型メソッド説明final org.springframework.expression.EvaluationContextcreateEvaluationContext(@Nullable Authentication authentication, T invocation) 内部テンプレートメソッドを呼び出して、StandardEvaluationContextおよびSecurityExpressionRootオブジェクトを作成します。protected org.springframework.expression.spel.support.StandardEvaluationContextcreateEvaluationContextInternal(@Nullable Authentication authentication, T invocation) オーバーライドして、StandardEvaluationContextのカスタムインスタンスを作成します。protected abstract SecurityExpressionOperationscreateSecurityExpressionRoot(@Nullable Authentication authentication, T invocation) サポートされている呼び出し型に対して正しい型のルートオブジェクトを作成するために実装します。protected final AuthorizationManagerFactory<T>protected @Nullable org.springframework.expression.BeanResolverprotected final DefaultAuthorizationManagerFactory<T>使用すべきではありません。final org.springframework.expression.ExpressionParserprotected PermissionEvaluatorprotected @Nullable RoleHierarchy使用すべきではありません。代わりにgetDefaultAuthorizationManagerFactory()を使用してくださいvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) final voidsetAuthorizationManagerFactory(AuthorizationManagerFactory<T> authorizationManagerFactory) 使用するAuthorizationManagerFactoryを設定します。final voidsetExpressionParser(org.springframework.expression.ExpressionParser expressionParser) voidsetPermissionEvaluator(PermissionEvaluator permissionEvaluator) voidsetRoleHierarchy(@Nullable RoleHierarchy roleHierarchy) 使用すべきではありません。代わりにsetAuthorizationManagerFactory(AuthorizationManagerFactory)を使用してくださいクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.security.access.expression.SecurityExpressionHandler から継承されたメソッド
createEvaluationContext
コンストラクターの詳細
AbstractSecurityExpressionHandler
public AbstractSecurityExpressionHandler()
メソッドの詳細
getExpressionParser
public final org.springframework.expression.ExpressionParser getExpressionParser()- 次で指定:
- インターフェース
SecurityExpressionHandler<T>のgetExpressionParser - 戻り値:
- 実装で使用される式の式パーサー。
setExpressionParser
public final void setExpressionParser(org.springframework.expression.ExpressionParser expressionParser) createEvaluationContext
public final org.springframework.expression.EvaluationContext createEvaluationContext(@Nullable Authentication authentication, T invocation) 内部テンプレートメソッドを呼び出して、StandardEvaluationContextおよびSecurityExpressionRootオブジェクトを作成します。- 次で指定:
- インターフェース
SecurityExpressionHandler<T>のcreateEvaluationContext - パラメーター:
authentication- 現在の認証オブジェクトinvocation- 呼び出し (フィルター、メソッド、チャネル)- 戻り値:
- 式の評価に使用するコンテキストオブジェクトで、適切なルートオブジェクトが入力されています。
createEvaluationContextInternal
protected org.springframework.expression.spel.support.StandardEvaluationContext createEvaluationContextInternal(@Nullable Authentication authentication, T invocation) オーバーライドして、StandardEvaluationContextのカスタムインスタンスを作成します。返されるオブジェクトには
SecurityExpressionRootPropertyAccessorが追加され、式のプロパティを介してApplicationContext内の Bean にアクセスできるようになります。- パラメーター:
authentication- 現在の認証オブジェクトinvocation- 呼び出し (フィルター、メソッド、チャネル)- 戻り値:
StandardEvaluationContextまたはオーバーライドされる可能性のあるカスタムサブクラス。
createSecurityExpressionRoot
protected abstract SecurityExpressionOperations createSecurityExpressionRoot(@Nullable Authentication authentication, T invocation) サポートされている呼び出し型に対して正しい型のルートオブジェクトを作成するために実装します。- パラメーター:
authentication- 現在の認証オブジェクトinvocation- 呼び出し (フィルター、メソッド、チャネル)- 戻り値:
- オブジェクト
setAuthorizationManagerFactory
public final void setAuthorizationManagerFactory(AuthorizationManagerFactory<T> authorizationManagerFactory) 使用するAuthorizationManagerFactoryを設定します。デフォルトはDefaultAuthorizationManagerFactoryです。- パラメーター:
authorizationManagerFactory- 使用するAuthorizationManagerFactory。null にはできません。- 導入:
- 7.0
getAuthorizationManagerFactory
getDefaultAuthorizationManagerFactory
@DeprecatedSE(since="7.0") protected final DefaultAuthorizationManagerFactory<T> getDefaultAuthorizationManagerFactory()使用すべきではありません。代わりにsetAuthorizationManagerFactory(AuthorizationManagerFactory)を使用してくださいDefaultAuthorizationManagerFactoryにアクセスしてデフォルト値を取得および設定できるようにします。このメソッドは Spring Security 8 では削除されます。- 戻り値:
DefaultAuthorizationManagerFactory- 例外:
IllegalStateExceptionSE- 異なるAuthorizationManagerFactoryがすでに設定されている場合
getRoleHierarchy
使用すべきではありません。代わりにgetDefaultAuthorizationManagerFactory()を使用してくださいsetRoleHierarchy
使用すべきではありません。代わりにsetAuthorizationManagerFactory(AuthorizationManagerFactory)を使用してくださいgetPermissionEvaluator
setPermissionEvaluator
getBeanResolver
protected @Nullable org.springframework.expression.BeanResolver getBeanResolver()setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - 次で指定:
- インターフェース
org.springframework.context.ApplicationContextAwareのsetApplicationContext
setAuthorizationManagerFactory(AuthorizationManagerFactory)を使用してください