-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathMicronautSecurity.qll
More file actions
38 lines (34 loc) · 1.11 KB
/
MicronautSecurity.qll
File metadata and controls
38 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Provides classes for identifying Micronaut Security annotations.
*
* Micronaut Security provides the `@Secured` annotation and integrates
* with standard `@RolesAllowed` for method-level access control.
*/
overlay[local?]
module;
import java
/**
* The annotation type `@Secured` from `io.micronaut.security.annotation`.
*/
class MicronautSecuredAnnotation extends AnnotationType {
MicronautSecuredAnnotation() {
this.hasQualifiedName("io.micronaut.security.annotation", "Secured")
}
}
/**
* A callable (method or constructor) that is annotated with Micronaut's `@Secured`
* annotation, either directly or via its declaring type.
*/
class MicronautSecuredCallable extends Callable {
MicronautSecuredCallable() {
this.getAnAnnotation().getType() instanceof MicronautSecuredAnnotation
or
this.getDeclaringType().getAnAnnotation().getType() instanceof MicronautSecuredAnnotation
}
}
/**
* A class annotated with Micronaut's `@Secured` annotation.
*/
class MicronautSecuredClass extends Class {
MicronautSecuredClass() { this.getAnAnnotation().getType() instanceof MicronautSecuredAnnotation }
}