クラス AuthorizeHttpRequestsConfigurer.AuthorizedUrl
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizedUrl
- 含まれているクラス:
- AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>
public class AuthorizeHttpRequestsConfigurer.AuthorizedUrl extends java.lang.Object
RequestMatcher
用にAuthorizationManager
を構成できるようにするオブジェクト。
メソッドのサマリー
メソッドの詳細
getMatchers
protected java.util.List<? extends RequestMatcher> getMatchers()
permitAll
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry permitAll()
URL が誰でも許可されていることを指定します。- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
denyAll
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry denyAll()
URL が誰にも許可されていないことを指定します。- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
hasRole
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasRole(java.lang.String role)
ユーザーにロールが必要であることを指定します。- パラメーター:
role
- 自動的に ROLE_ が付加される必要なロール(つまり、USER、ADMIN など)。ROLE_ で始まるべきではありません- 戻り値:
- さらなるカスタマイズのための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
hasAnyRole
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAnyRole(java.lang.String... roles)
ユーザーが多くのロールの 1 つを必要とすることを指定します。- パラメーター:
roles
- ユーザーが少なくとも 1 つ持つ必要のあるロール(つまり、ADMIN、USER など)。各ロールはすでに自動的に追加されるため、ROLE_ で開始しないでください- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
hasAuthority
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAuthority(java.lang.String authority)
ユーザーに権限が必要であることを指定します。- パラメーター:
authority
- 必要な権限- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
hasAnyAuthority
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAnyAuthority(java.lang.String... authorities)
ユーザーが多くの権限の 1 つを必要とすることを指定します。- パラメーター:
authorities
- ユーザーが少なくとも 1 つ持っている必要がある権限 (つまり、ROLE_USER、ROLE_ADMIN など)- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
authenticated
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry authenticated()
認証されたユーザーが URL を許可することを指定します。- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry
access
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry access(AuthorizationManager<RequestAuthorizationContext> manager)
カスタムAuthorizationManager
を指定できます。- パラメーター:
manager
- 使用するAuthorizationManager
- 戻り値:
- さらにカスタマイズするための
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry