クラス AllAuthoritiesAuthorizationManager<T>
java.lang.ObjectSE
org.springframework.security.authorization.AllAuthoritiesAuthorizationManager<T>
- 実装されているすべてのインターフェース:
AuthorizationManager<T>
public final class AllAuthoritiesAuthorizationManager<T>
extends ObjectSE
implements AuthorizationManager<T>
Authentication に指定された権限がすべて含まれているかどうかを評価して、現在のユーザーが承認されているかどうかを判断する AuthorizationManager。- 導入:
- 7.0
- 関連事項:
方法の概要
修飾子と型メソッド説明authorize(SupplierSE<? extends @Nullable Authentication> authentication, T object) Authenticationに指定された権限が含まれているかどうかを評価することによって、現在のユーザーが認可されているかどうかを判別します。static <T> AllAuthoritiesAuthorizationManager<T>hasAllAuthorities(StringSE... authorities) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。static <T> AllAuthoritiesAuthorizationManager<T>hasAllAuthorities(ListSE<StringSE> authorities) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。static <T> AllAuthoritiesAuthorizationManager<T>hasAllPrefixedAuthorities(StringSE prefix, StringSE... authorities) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。static <T> AllAuthoritiesAuthorizationManager<T>hasAllRoles(StringSE... roles) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。voidsetRoleHierarchy(RoleHierarchy roleHierarchy) 使用するRoleHierarchyを設定します。クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.security.authorization.AuthorizationManager から継承されたメソッド
verify
メソッドの詳細
setRoleHierarchy
使用するRoleHierarchyを設定します。デフォルトはNullRoleHierarchyです。null にすることはできません。- パラメーター:
roleHierarchy- 使用するRoleHierarchy
authorize
public AuthorityAuthorizationDecision authorize(SupplierSE<? extends @Nullable Authentication> authentication, T object) Authenticationに指定された権限が含まれているかどうかを評価することによって、現在のユーザーが認可されているかどうかを判別します。- 次で指定:
- インターフェース
AuthorizationManager<T>のauthorize - パラメーター:
authentication- チェックするAuthenticationのSupplierSEobject- 認可をチェックするオブジェクト(使用されません)。- 戻り値:
AuthorityAuthorizationDecision
hasAllRoles
指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。- 型パラメーター:
T- 認可されるオブジェクトの型- パラメーター:
roles- "ROLE_" で始まるチェックする権限。各ロールは "ROLE_" で開始しないでください。これは自動的に先頭に追加されるためです。- 戻り値:
- 新しいインスタンス
hasAllPrefixedAuthorities
public static <T> AllAuthoritiesAuthorizationManager<T> hasAllPrefixedAuthorities(StringSE prefix, StringSE... authorities) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。- 型パラメーター:
T- 認可されるオブジェクトの型- パラメーター:
prefix-authoritiesのプレフィックスauthorities- プレフィックスがprefixであるかどうかを確認する権限- 戻り値:
- 新しいインスタンス
hasAllAuthorities
指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。- 型パラメーター:
T- 認可されるオブジェクトの型- パラメーター:
authorities- チェックする権限- 戻り値:
- 新しいインスタンス
hasAllAuthorities
public static <T> AllAuthoritiesAuthorizationManager<T> hasAllAuthorities(ListSE<StringSE> authorities) 指定された権限でAllAuthoritiesAuthorizationManagerのインスタンスを作成します。- 型パラメーター:
T- 認可されるオブジェクトの型- パラメーター:
authorities- チェックする権限- 戻り値:
- 新しいインスタンス