How do I access the Principal information from the EJB?
@MethodPermissions({"student"})
@TransactionAttribute(TransactionAttributeType.REQUIRESNEW)
public boolean doSomething(Quote quote) {
. . .
}
I know when a user does not have permission to access a method it returns an error stating the Principal name and than the role. So I am assuming that the EJB does know the principal, so how do I find out which user is accessing the method?
You need to use the ejb context getCallerPrincipal.