GIAC
GSSP-JAVA · Question #120
GSSP-JAVA Question #120: Real Exam Question with Answer & Explanation
The correct answer is B. If EJBContext.isCallerInRole("ADMIN") returns true, implement the behavior defined for C. Annotate method doPrint() with @RolesAllowed({"ADMIN","MANAGER"}).. See the full explanation below for the reasoning.
Question
You work as a developer for PassGuide Inc. You have implemented a session bean with a method doPrint(), which behaves differently depending on the caller's security role. Only MANAGER in the security roles "ADMIN" and "MANAGER" are allowed to call the method. Which of the following actions are appropriate to accomplish if there is no security-related metadata in the deployment descriptor? Each correct answer represents a complete solution. Choose all that apply.
Options
- AIf EJBContext.getCallerPrincipal returns role "ADMIN", implement the behavior for
- BIf EJBContext.isCallerInRole("ADMIN") returns true, implement the behavior defined for
- CAnnotate method doPrint() with @RolesAllowed({"ADMIN","MANAGER"}).
- DAnnotate method doPrint() with @PermitAll.
Community Discussion
No community discussion yet for this question.