nerdexam
GIAC

GSSP-JAVA · Question #148

You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the…

The correct answer is A. Use the <run-as> element of the deployment descriptor and declare the <role-name> as B. Use the @RunAs("ADMIN") annotation to allow the HR the privileges as ADMIN. C. Use the @RunAs("DBA") annotation to allow the HR the privileges as DBA. D. Use the <method-permission> element of the deployment descriptor to declare the role-. See the full explanation below for the reasoning.

Question

You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the ADMIN role. The EmpSal() method can be accessed only by the HR role, while the EmpAttendance () method can be accessed only by the DBA role. You want the EmpAttendance() method to be accessed by the HR role also. However, no other roles in the class except ADMIN, DBA, and HR should be able to access the EmpAttendance() method. Which of the following steps will you take to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.

Options

  • AUse the <run-as> element of the deployment descriptor and declare the <role-name> as
  • BUse the @RunAs("ADMIN") annotation to allow the HR the privileges as ADMIN.
  • CUse the @RunAs("DBA") annotation to allow the HR the privileges as DBA.
  • DUse the <method-permission> element of the deployment descriptor to declare the role-
  • EUse the @PermitAll annotation with the EmpAttendance() method to allow the HR to

How the community answered

(34 responses)
  • A
    79% (27)
  • E
    21% (7)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice