Package io.micronaut.security.rules
Class SecuredAnnotationRule
java.lang.Object
io.micronaut.security.rules.AbstractSecurityRule<io.micronaut.http.HttpRequest<?>>
io.micronaut.security.rules.SecuredAnnotationRule
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,SecurityRule<io.micronaut.http.HttpRequest<?>>
@Requires(classes=io.micronaut.http.HttpRequest.class)
@Singleton
public class SecuredAnnotationRule
extends AbstractSecurityRule<io.micronaut.http.HttpRequest<?>>
Security rule implementation for the
Secured annotation.- Since:
- 1.0
- Author:
- James Kleeh
-
Field Summary
FieldsFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface io.micronaut.security.rules.SecurityRule
DENY_ALL, IS_ANONYMOUS, IS_AUTHENTICATED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<SecurityRuleResult>check(io.micronaut.http.HttpRequest<?> request, @Nullable Authentication authentication) ReturnsSecurityRuleResult.UNKNOWNif theSecuredannotation is not found on the method or class, or if the route match is not method based.intgetOrder()Methods inherited from class io.micronaut.security.rules.AbstractSecurityRule
compareRoles, getRoles
-
Field Details
-
ORDER
The order of the rule.
-
-
Constructor Details
-
SecuredAnnotationRule
- Parameters:
rolesFinder- Roles Parser
-
-
Method Details
-
check
public org.reactivestreams.Publisher<SecurityRuleResult> check(io.micronaut.http.HttpRequest<?> request, @Nullable @Nullable Authentication authentication) ReturnsSecurityRuleResult.UNKNOWNif theSecuredannotation is not found on the method or class, or if the route match is not method based.- Parameters:
request- The current requestauthentication- The authentication, or null if none found- Returns:
- The result
- See Also:
-
getOrder
public int getOrder()
-