クラス DefaultMethodSecurityExpressionHandler
java.lang.ObjectSE
org.springframework.security.access.expression.AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>
org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler
- 実装されているすべてのインターフェース:
org.springframework.aop.framework.AopInfrastructureBean、org.springframework.beans.factory.Aware、org.springframework.context.ApplicationContextAware、MethodSecurityExpressionHandler、SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>
public class DefaultMethodSecurityExpressionHandler
extends AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>
implements MethodSecurityExpressionHandler
MethodSecurityExpressionHandler の標準実装。通常、単一のインスタンスは、式のサポートを必要とする Bean 間で共有する必要があります。
- 導入:
- 3.0
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明org.springframework.expression.EvaluationContextcreateEvaluationContext(SupplierSE<? extends @Nullable Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) 呼び出し型のセキュリティ式を評価するための評価コンテキストを提供します。org.springframework.expression.spel.support.StandardEvaluationContextcreateEvaluationContextInternal(@Nullable Authentication auth, org.aopalliance.intercept.MethodInvocation mi) MethodSecurityEvaluationContextを EvaluationContext 実装として使用します。protected MethodSecurityExpressionOperationscreateSecurityExpressionRoot(@Nullable Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation) 式評価用のルートオブジェクトを作成します。filter(@Nullable ObjectSE filterTarget, org.springframework.expression.Expression filterExpression, org.springframework.expression.EvaluationContext ctx) 指定された式を評価して、filterTargetオブジェクト (CollectionSE、Array、MapSE、またはStreamSE のいずれかである必要があります) をフィルタリングします。protected StringSE使用すべきではありません。protected org.springframework.core.ParameterNameDiscovererprotected AuthenticationTrustResolver使用すべきではありません。voidsetDefaultRolePrefix(@Nullable StringSE defaultRolePrefix) 使用すべきではありません。voidsetParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer) 使用するParameterNameDiscovererを設定します。voidsetPermissionCacheOptimizer(PermissionCacheOptimizer permissionCacheOptimizer) voidsetReturnObject(@Nullable ObjectSE returnObject, org.springframework.expression.EvaluationContext ctx) 指定された評価コンテキストの戻りオブジェクトを式システムに通知するために使用されます。voidsetTrustResolver(AuthenticationTrustResolver trustResolver) 使用すべきではありません。クラス org.springframework.security.access.expression.AbstractSecurityExpressionHandler から継承されたメソッド
createEvaluationContext, getAuthorizationManagerFactory, getBeanResolver, getDefaultAuthorizationManagerFactory, getExpressionParser, getPermissionEvaluator, getRoleHierarchy, setApplicationContext, setAuthorizationManagerFactory, setExpressionParser, setPermissionEvaluator, setRoleHierarchyクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.security.access.expression.SecurityExpressionHandler から継承されたメソッド
createEvaluationContext, getExpressionParser
フィールドの詳細
logger
protected final org.apache.commons.logging.Log logger
コンストラクターの詳細
DefaultMethodSecurityExpressionHandler
public DefaultMethodSecurityExpressionHandler()
メソッドの詳細
createEvaluationContextInternal
public org.springframework.expression.spel.support.StandardEvaluationContext createEvaluationContextInternal(@Nullable Authentication auth, org.aopalliance.intercept.MethodInvocation mi) MethodSecurityEvaluationContextを EvaluationContext 実装として使用します。- オーバーライド:
- クラス
AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>のcreateEvaluationContextInternal - パラメーター:
auth- 現在の認証オブジェクトmi- 呼び出し (フィルター、メソッド、チャネル)- 戻り値:
StandardEvaluationContextまたはオーバーライドされる可能性のあるカスタムサブクラス。
createEvaluationContext
public org.springframework.expression.EvaluationContext createEvaluationContext(SupplierSE<? extends @Nullable Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) インターフェースからコピーされた説明:SecurityExpressionHandler呼び出し型のセキュリティ式を評価するための評価コンテキストを提供します。Authenticationオブジェクトの遅延初期化を使用するカスタム実装を提供するために、このメソッドをオーバーライドできます。デフォルトでは、このメソッドはAuthenticationオブジェクトの先行初期化を使用します。- 次で指定:
- インターフェース
SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>のcreateEvaluationContext - パラメーター:
authentication- 使用するAuthenticationのSupplierSEmi- 使用するSecurityExpressionHandler- 戻り値:
- 使用する
EvaluationContext
createSecurityExpressionRoot
protected MethodSecurityExpressionOperations createSecurityExpressionRoot(@Nullable Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation) 式評価用のルートオブジェクトを作成します。- 次で指定:
- クラス
AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation>のcreateSecurityExpressionRoot - パラメーター:
authentication- 現在の認証オブジェクトinvocation- 呼び出し (フィルター、メソッド、チャネル)- 戻り値:
- オブジェクト
filter
public ObjectSE filter(@Nullable ObjectSE filterTarget, org.springframework.expression.Expression filterExpression, org.springframework.expression.EvaluationContext ctx) 指定された式を評価して、filterTargetオブジェクト (CollectionSE、Array、MapSE、またはStreamSE のいずれかである必要があります) をフィルタリングします。指定された
filterTargetオブジェクトと同じ型の新しいインスタンスを返します- 次で指定:
- インターフェース
MethodSecurityExpressionHandlerのfilter - パラメーター:
filterTarget- フィルタリングする配列またはコレクション。filterExpression- フィルター条件として使用される式。評価時に false を返す場合、オブジェクトは返されたコレクションから削除されますctx- 現在の評価コンテキスト(SecurityExpressionHandler.createEvaluationContext(org.springframework.security.core.Authentication, Object)の呼び出しを通じて作成されたもの)- 戻り値:
- フィルタリングされた
CollectionSE、Array、MapSE、StreamSE
setTrustResolver
使用すべきではありません。使用するAuthenticationTrustResolverを設定します。デフォルトはAuthenticationTrustResolverImplです。- パラメーター:
trustResolver- 使用するAuthenticationTrustResolver。null にはできません。
getTrustResolver
使用すべきではありません。- 戻り値:
- 現在の
AuthenticationTrustResolver
setParameterNameDiscoverer
public void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer) 使用するParameterNameDiscovererを設定します。デフォルトはDefaultSecurityParameterNameDiscovererです。- パラメーター:
parameterNameDiscoverer-
getParameterNameDiscoverer
protected org.springframework.core.ParameterNameDiscoverer getParameterNameDiscoverer()- 戻り値:
- 現在の
ParameterNameDiscoverer
setPermissionCacheOptimizer
setReturnObject
public void setReturnObject(@Nullable ObjectSE returnObject, org.springframework.expression.EvaluationContext ctx) インターフェースからコピーされた説明:MethodSecurityExpressionHandler指定された評価コンテキストの戻りオブジェクトを式システムに通知するために使用されます。メソッド呼び出しにのみ適用されます。- 次で指定:
- インターフェース
MethodSecurityExpressionHandlerのsetReturnObject - パラメーター:
returnObject- 戻りオブジェクト値ctx- オブジェクトを設定するコンテキスト(SecurityExpressionHandler.createEvaluationContext(org.springframework.security.core.Authentication, Object)の呼び出しで作成されたもの)
setDefaultRolePrefix
使用すべきではありません。SecurityExpressionRoot.hasAnyRole(String...)またはSecurityExpressionRoot.hasRole(String)に追加するデフォルトのプレフィックスを設定します。例: hasRole("ADMIN" ) または hasRole("ROLE_ADMIN" ) が渡された場合、defaultRolePrefix が "ROLE_" (デフォルト) のときはロール ROLE_ADMIN が使用されます。null または空の場合、デフォルトのロールプレフィックスは使用されません。
- パラメーター:
defaultRolePrefix- ロールに追加するデフォルトのプレフィックス。デフォルトは "ROLE_"。
getDefaultRolePrefix
使用すべきではありません。- 戻り値:
- デフォルトのロール接頭辞
AbstractSecurityExpressionHandler.setAuthorizationManagerFactory(AuthorizationManagerFactory)を使用してください