RunAs (Common Annotations 3.0 API Documentation - Apache Tomcat 11.0.24)
Description: declaration: package: jakarta.annotation.security, annotation type: RunAs

# Annotation Interface RunAs

@Documented @Target(TYPE) @Retention(RUNTIME) public @interface RunAs
Defines the run-as security role for an enterprise bean. The container assumes the specified role as the caller identity for all business method invocations made by the bean, regardless of the actual caller's identity. This allows the bean to access resources with a consistent security context.

Since:
  Common Annotations 1.0

- ## Required Element Summary

  Required Elements
  Modifier and Type
  Required Element
  Description
  `String`
  `value`
  Specifies the security role name that the container should assume as the caller identity when executing business methods on behalf of this component.

- ## Element Details

  - ### value

    String value
    Specifies the security role name that the container should assume as the caller identity when executing business methods on behalf of this component.
    Returns:
      the run-as role name