Environment: JBoss 3.2.3
I have a Stateless Session Bean and within one of the business methods, I have code
that looks something like this:
/**
* @ejb.interface-method
* @ejb.permission role-name = "Manager, Director"
*/
1 public void doSomething() {
2 Principal loggedUser = sessionContext.getCallerPrincipal();
3
4 System.out.println("Logged in user is: " + loggedUser.getName());
5 System.out.println("role [Manager]: " + String.valueOf(sessionContext.isCallerInRole("Manager")));
6 System.out.println("role [CEO]: " + String.valueOf(sessionContext.isCallerInRole("CEO")));
/* etc.... */
}
INFO [STDOUT] Logged in user is: superman
WARN [org.jboss.ejb.EnterpriseContext] no match found for security role Manager in the deployment descriptor.
INFO [STDOUT] role [Manager]: true
WARN [org.jboss.ejb.EnterpriseContext] no match found for security role CEO in the deployment descriptor.
INFO [STDOUT] role [CEO]: false