Package io.micronaut.security.annotation
Annotation Type Secured
-
@Target({METHOD,TYPE}) @Retention(RUNTIME) @Inherited @Documented public @interface Secured
Used to mark a route as requiring authorization before execution. When the annotation is placed on a method, it overrides the value of the annotation at the class level, if it exists.- Since:
- 1.0
- Author:
- James Kleeh
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String[]
value
The values supplied will be used to secure the target.
-
-
-
Element Detail
-
value
java.lang.String[] value
The values supplied will be used to secure the target. The values will be compared using "OR". If the authenticated principal contains any of the roles or tokens provided, the principal will be authorized to access the resource. The values can be a role (eg ROLE_ADMIN), or a token.- Returns:
- The list of roles or tokens
- See Also:
SecurityRule.IS_AUTHENTICATED
,SecurityRule.IS_ANONYMOUS
-
-