• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about isCallerInRole-Question

 
Christian Nicoll
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I can't understand the following questions (and answer) from enthuware:

What does the method isCallerInRole do?
a) It tests whether the caller of the bean belongs to the role that is passed as a parameter to this method.
b) It tests whether the caller's role exists in the application's security domain.
c) It tests whether the caller exists in the roles defined by the beans.
d) It tests whether the role passed in as a parameter exists in the application's security domain.


Enthuware says that answer a) is correct, but I don't think that there is a role-parameter which is passed into the method. There is only a @RolesAllowed annotation, which defines the roles that are able to execute the method. So, I think that option c) is the correct one.

Can someone please explain me this?

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is about the isCallerInRole method in javax.ejb.EJBContext. Look at its signature :

public boolean isCallerInRole(String roleName)
Test if the caller has a given security role.
Parameters:
roleName - The name of the security role. The role must be one of the security roles that is defined in the deployment descriptor.
Returns:
True if the caller has the specified role.
 
Christian Nicoll
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Christoph,

thanks for your answer. I'm now able to understand why option a) is the only valid answer for this question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic