Class MessageMatcherDelegatingAuthorizationManager.Builder.Constraint
- java.lang.Object
-
- org.springframework.security.messaging.access.intercept.MessageMatcherDelegatingAuthorizationManager.Builder.Constraint
-
- Enclosing class:
- MessageMatcherDelegatingAuthorizationManager.Builder
public final class MessageMatcherDelegatingAuthorizationManager.Builder.Constraint extends java.lang.Object
Represents the security constraint to be applied to theMessageMatcher
instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageMatcherDelegatingAuthorizationManager.Builder
access(AuthorizationManager<MessageAuthorizationContext<?>> authorizationManager)
Allows specifying that Messages are secured by an arbitrary expressionMessageMatcherDelegatingAuthorizationManager.Builder
anonymous()
Specify that Messages are allowed by anonymous users.MessageMatcherDelegatingAuthorizationManager.Builder
authenticated()
Specify that Messages are allowed by any authenticated user.MessageMatcherDelegatingAuthorizationManager.Builder
denyAll()
Specify that Messages are not allowed by anyone.MessageMatcherDelegatingAuthorizationManager.Builder
fullyAuthenticated()
Specify that Messages are allowed by users who have authenticated and were not "remembered".MessageMatcherDelegatingAuthorizationManager.Builder
hasAnyAuthority(java.lang.String... authorities)
Specify thatMessage
instances requires any of a number authorities.MessageMatcherDelegatingAuthorizationManager.Builder
hasAnyRole(java.lang.String... roles)
Shortcut for specifyingMessage
instances require any of a number of roles.MessageMatcherDelegatingAuthorizationManager.Builder
hasAuthority(java.lang.String authority)
Specify thatMessage
instances require a particular authority.MessageMatcherDelegatingAuthorizationManager.Builder
hasRole(java.lang.String role)
Shortcut for specifyingMessage
instances require a particular role.MessageMatcherDelegatingAuthorizationManager.Builder
permitAll()
Specify that Messages are allowed by anyone.MessageMatcherDelegatingAuthorizationManager.Builder
rememberMe()
Specify that Messages are allowed by users that have been remembered.
-
-
-
Method Detail
-
hasRole
public MessageMatcherDelegatingAuthorizationManager.Builder hasRole(java.lang.String role)
Shortcut for specifyingMessage
instances require a particular role. If you do not want to have "ROLE_" automatically inserted seehasAuthority(String)
.- Parameters:
role
- the role to require (i.e. USER, ADMIN, etc). Note, it should not start with "ROLE_" as this is automatically inserted.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
hasAnyRole
public MessageMatcherDelegatingAuthorizationManager.Builder hasAnyRole(java.lang.String... roles)
Shortcut for specifyingMessage
instances require any of a number of roles. If you do not want to have "ROLE_" automatically inserted seehasAnyAuthority(String...)
- Parameters:
roles
- the roles to require (i.e. USER, ADMIN, etc). Note, it should not start with "ROLE_" as this is automatically inserted.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
hasAuthority
public MessageMatcherDelegatingAuthorizationManager.Builder hasAuthority(java.lang.String authority)
Specify thatMessage
instances require a particular authority.- Parameters:
authority
- the authority to require (i.e. ROLE_USER, ROLE_ADMIN, etc).- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
hasAnyAuthority
public MessageMatcherDelegatingAuthorizationManager.Builder hasAnyAuthority(java.lang.String... authorities)
Specify thatMessage
instances requires any of a number authorities.- Parameters:
authorities
- the requests require at least one of the authorities (i.e. "ROLE_USER","ROLE_ADMIN" would mean either "ROLE_USER" or "ROLE_ADMIN" is required).- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
permitAll
public MessageMatcherDelegatingAuthorizationManager.Builder permitAll()
Specify that Messages are allowed by anyone.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
denyAll
public MessageMatcherDelegatingAuthorizationManager.Builder denyAll()
Specify that Messages are not allowed by anyone.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
authenticated
public MessageMatcherDelegatingAuthorizationManager.Builder authenticated()
Specify that Messages are allowed by any authenticated user.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
fullyAuthenticated
public MessageMatcherDelegatingAuthorizationManager.Builder fullyAuthenticated()
Specify that Messages are allowed by users who have authenticated and were not "remembered".- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization - Since:
- 5.8
-
rememberMe
public MessageMatcherDelegatingAuthorizationManager.Builder rememberMe()
Specify that Messages are allowed by users that have been remembered.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization - Since:
- 5.8
-
anonymous
public MessageMatcherDelegatingAuthorizationManager.Builder anonymous()
Specify that Messages are allowed by anonymous users.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization - Since:
- 5.8
-
access
public MessageMatcherDelegatingAuthorizationManager.Builder access(AuthorizationManager<MessageAuthorizationContext<?>> authorizationManager)
Allows specifying that Messages are secured by an arbitrary expression- Parameters:
authorizationManager
- theAuthorizationManager
to secure the destinations- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization
-
-