RolesAllowed (Common Annotations 2.1 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.annotation.security, annotation type: RolesAllowed

# Annotation Type RolesAllowed

@Documented @Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface RolesAllowed
Specifies the security roles that are allowed to access the annotated enterprise bean or business method. When applied at the class level, only the listed roles may invoke any business method of the bean. When applied at the method level, only the listed roles may invoke the specified method. This annotation is mutually exclusive with `PermitAll` and `DenyAll`.

Since:
  Common Annotations 1.0

- ## Required Element Summary

  Required Elements
  Modifier and Type
  Required Element
  Description
  `String[]`
  `value`
  Specifies the security role names that are authorized to access the annotated component or method.

- ## Element Details

  - ### value

    String[] value
    Specifies the security role names that are authorized to access the annotated component or method. Only callers assigned one of these roles will be permitted access.
    Returns:
      the array of authorized role names