Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EPractice Lab mock final exam quesiton 53

 
Himai Minh
Ranch Hand
Posts: 1398
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this question, there are two model answers :
option b : annotate method processLicense with @RolesAllowed( {"CORPORATECUSTOMER" , "CUSTOMER" }....);
option d: if EJBContext.isCallerInRole("CORPORATECUSTOMER") return true.....

I think for option b, it should be @DeclareRoles instead.

According to session 17.2.5.3, the roles declared in @DeclareRoles can be tested with isCallerInRole.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!