public class DefaultMethodSecurityExpressionHandler extends AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> implements MethodSecurityExpressionHandler
MethodSecurityExpressionHandler の標準実装。通常、単一のインスタンスは、式のサポートを必要とする Bean 間で共有する必要があります。
| 修飾子と型 | フィールドと説明 |
|---|---|
protected org.apache.commons.logging.Log | logger |
| コンストラクターと説明 |
|---|
DefaultMethodSecurityExpressionHandler() |
| 修飾子と型 | メソッドと説明 |
|---|---|
org.springframework.expression.spel.support.StandardEvaluationContext | createEvaluationContextInternal(Authentication auth, org.aopalliance.intercept.MethodInvocation mi)MethodSecurityEvaluationContext を EvaluationContext 実装として使用します。 |
protected MethodSecurityExpressionOperations | createSecurityExpressionRoot(Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation) 式評価用のルートオブジェクトを作成します。 |
java.lang.Object | filter(java.lang.Object filterTarget, org.springframework.expression.Expression filterExpression, org.springframework.expression.EvaluationContext ctx) 指定された式を評価することにより、 filterTarget オブジェクト(コレクション、配列、ストリームでなければなりません)をフィルターします。 |
protected java.lang.String | getDefaultRolePrefix() |
protected org.springframework.core.ParameterNameDiscoverer | getParameterNameDiscoverer() |
protected AuthenticationTrustResolver | getTrustResolver() |
void | setDefaultRolePrefix(java.lang.String defaultRolePrefix)SecurityExpressionRoot.hasAnyRole(String...) または SecurityExpressionRoot.hasRole(String) に追加されるデフォルトのプレフィックスを設定します。 |
void | setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer) 使用する ParameterNameDiscoverer を設定します。 |
void | setPermissionCacheOptimizer(PermissionCacheOptimizer permissionCacheOptimizer) |
void | setReturnObject(java.lang.Object returnObject, org.springframework.expression.EvaluationContext ctx) 指定された評価コンテキストの戻りオブジェクトを式システムに通知するために使用されます。 |
void | setTrustResolver(AuthenticationTrustResolver trustResolver) 使用する AuthenticationTrustResolver を設定します。 |
createEvaluationContext, getExpressionParser, getPermissionEvaluator, getRoleHierarchy, setApplicationContext, setExpressionParser, setPermissionEvaluator, setRoleHierarchyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateEvaluationContext, getExpressionParserpublic org.springframework.expression.spel.support.StandardEvaluationContext createEvaluationContextInternal(Authentication auth, org.aopalliance.intercept.MethodInvocation mi)
MethodSecurityEvaluationContext を EvaluationContext 実装として使用します。AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> の createEvaluationContextInternal auth - 現在の認証オブジェクト mi - 呼び出し (フィルター、メソッド、チャネル)StandardEvaluationContext またはオーバーライドされる可能性のあるカスタムサブクラス。protected MethodSecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation)
AbstractSecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> の createSecurityExpressionRoot authentication - 現在の認証オブジェクト invocation - 呼び出し (フィルター、メソッド、チャネル)public java.lang.Object filter(java.lang.Object filterTarget,
org.springframework.expression.Expression filterExpression,
org.springframework.expression.EvaluationContext ctx)filterTarget オブジェクト(コレクション、配列、ストリームでなければなりません)をフィルターします。Collection を使用する場合、元のインスタンスは、許可式が true に評価される要素を含むように変更されます。配列の場合、新しい配列インスタンスが返されます。
MethodSecurityExpressionHandler 内の filter filterTarget - フィルタリングする配列またはコレクション。filterExpression - フィルター条件として使用される式。評価時に false を返す場合、オブジェクトは返されたコレクションから削除されます ctx - 現在の評価コンテキスト(SecurityExpressionHandler.createEvaluationContext(org.springframework.security.core.Authentication, Object) の呼び出しを通じて作成されたもの)public void setTrustResolver(AuthenticationTrustResolver trustResolver)
AuthenticationTrustResolver を設定します。デフォルトは AuthenticationTrustResolverImpl です。trustResolver - 使用する AuthenticationTrustResolver。null にはできません。protected AuthenticationTrustResolver getTrustResolver()
AuthenticationTrustResolverpublic void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)
ParameterNameDiscoverer を設定します。デフォルトは DefaultSecurityParameterNameDiscoverer です。parameterNameDiscoverer -protected org.springframework.core.ParameterNameDiscoverer getParameterNameDiscoverer()
ParameterNameDiscovererpublic void setPermissionCacheOptimizer(PermissionCacheOptimizer permissionCacheOptimizer)
public void setReturnObject(java.lang.Object returnObject,
org.springframework.expression.EvaluationContext ctx)MethodSecurityExpressionHandlerMethodSecurityExpressionHandler 内の setReturnObject returnObject - 戻りオブジェクト値 ctx - オブジェクトを設定するコンテキスト(SecurityExpressionHandler.createEvaluationContext(org.springframework.security.core.Authentication, Object) の呼び出しで作成されたもの)public void setDefaultRolePrefix(java.lang.String defaultRolePrefix)
SecurityExpressionRoot.hasAnyRole(String...) または SecurityExpressionRoot.hasRole(String) に追加するデフォルトのプレフィックスを設定します。例: hasRole("ADMIN" ) または hasRole("ROLE_ADMIN" ) が渡された場合、defaultRolePrefix が "ROLE_" (デフォルト) のときはロール ROLE_ADMIN が使用されます。
null または空の場合、デフォルトのロールプレフィックスは使用されません。
defaultRolePrefix - ロールに追加するデフォルトのプレフィックス。デフォルトは "ROLE_"。protected java.lang.String getDefaultRolePrefix()