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 Details

    • ORDER

      public static final Integer ORDER
      The order of the rule.
  • Constructor Details

    • SecuredAnnotationRule

      public SecuredAnnotationRule(RolesFinder rolesFinder)
      Parameters:
      rolesFinder - Roles Parser
  • Method Details

    • check

      public org.reactivestreams.Publisher<SecurityRuleResult> check(io.micronaut.http.HttpRequest<?> request, @Nullable @Nullable Authentication authentication)
      Returns SecurityRuleResult.UNKNOWN if the Secured annotation is not found on the method or class, or if the route match is not method based.
      Parameters:
      request - The current request
      authentication - The authentication, or null if none found
      Returns:
      The result
      See Also:
    • getOrder

      public int getOrder()