Class SecuredAnnotationRule

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, SecurityRule

    @Singleton
    public class SecuredAnnotationRule
    extends AbstractSecurityRule
    Security rule implementation for the Secured annotation.
    Since:
    1.0
    • Field Detail

      • ORDER

        public static final java.lang.Integer ORDER
        The order of the rule.
    • Constructor Detail

      • SecuredAnnotationRule

        @Inject
        public SecuredAnnotationRule​(RolesFinder rolesFinder)
        Parameters:
        rolesFinder - Roles Parser
    • Method Detail

      • check

        public org.reactivestreams.Publisher<SecurityRuleResult> check​(io.micronaut.http.HttpRequest<?> request,
                                                                       @Nullable
                                                                       io.micronaut.web.router.RouteMatch<?> routeMatch,
                                                                       @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
        routeMatch - The matched route
        authentication - The authentication, or null if none found
        Returns:
        The result
        See Also:
        SecurityRuleResult
      • getOrder

        public int getOrder()