@Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        List<Annotation> authzSpecs = new ArrayList<>();
        var annotations = SHIRO_ANNOTATIONS;
        if (Boolean.TRUE.equals(context.getConfiguration().getProperty(SHIRO_WEB_JAXRS_DISABLE_PRINCIPAL_PARAM))) {
            annotations = Stream.concat(SHIRO_ANNOTATIONS.stream(), JSR_250_ANNOTATIONS.stream())
                    .collect(Collectors.toList());
        }

        for (Class<? extends Annotation> annotationClass : annotations) {
            // XXX What is the performance of getAnnotation vs getAnnotations?
            Annotation classAuthzSpec = resourceInfo.getResourceClass().getAnnotation(annotationClass);
            Annotation methodAuthzSpec = resourceInfo.getResourceMethod().getAnnotation(annotationClass);

            if (classAuthzSpec != null) {
                authzSpecs.add(classAuthzSpec);
            }
            if (methodAuthzSpec != null) {
                authzSpecs.add(methodAuthzSpec);
            }
        }

        if (!authzSpecs.isEmpty()) {
            context.register(new AnnotationAuthorizationFilter(authzSpecs), Priorities.AUTHORIZATION);
        }
    }
Wraps {@link AuthorizationFilter filters} around JAX-RS resources that are annotated with Shiro annotations.

@since 1.4
support/jaxrs/src/main/java/org/apache/shiro/web/jaxrs/ShiroAnnotationFilterFeature.java