クラス AuthorityUtils

java.lang.ObjectSE
org.springframework.security.core.authority.AuthorityUtils

public final class AuthorityUtils extends ObjectSE
GrantedAuthority コレクションなどを操作するためのユーティリティメソッド。

主に内部使用を目的としています。

  • フィールドの詳細

  • メソッドの詳細

    • commaSeparatedStringToAuthorityList

      public static ListSE<GrantedAuthority> commaSeparatedStringToAuthorityList(StringSE authorityString)
      カンマ区切りの文字列表現(「ROLE_A、ROLE_B、ROLE_C」など)から GrantedAuthority オブジェクトの配列を作成します。
      パラメーター:
      authorityString - カンマ区切りの文字列
      戻り値:
      文字列をトークン化して作成された権限
    • authorityListToSet

      public static SetSE<StringSE> authorityListToSet(CollectionSE<? extends GrantedAuthority> userAuthorities)
      GrantedAuthority オブジェクトの配列をセットに変換します。
      戻り値:
      GrantedAuthority.getAuthority() への各呼び出しから取得された文字列のセット
    • createAuthorityList

      public static ListSE<GrantedAuthority> createAuthorityList(StringSE... authorities)
      オーソリティを GrantedAuthority オブジェクトのリストに変換します。
      パラメーター:
      authorities - 改宗する権限
      戻り値:
      GrantedAuthority オブジェクトのリスト
    • createAuthorityList

      public static ListSE<GrantedAuthority> createAuthorityList(CollectionSE<StringSE> authorities)
      オーソリティを GrantedAuthority オブジェクトのリストに変換します。
      パラメーター:
      authorities - 改宗する権限
      戻り値:
      GrantedAuthority オブジェクトのリスト
      導入:
      6.1