Java EE 7 Application Developer — Question 14
Which annotation allows a request to be executed with another Principal's identity?
Answer options
- A. It is not possible to execute a request with another Principal's identity.
- B. @UseIdentity
- C. @RolesAllowed
- D. @Runs
Correct answer: C
Explanation
The correct answer is C, @RolesAllowed, which permits access to resources based on the roles assigned to a Principal. Option A is incorrect as it dismisses the possibility entirely, while B, @UseIdentity, and D, @Runs, are not standard annotations used for executing requests with alternate Principal identities.