// The caller is using a run-as identity
else
{
if(callerRunAs instanceof RunAsIdentity)
{
RunAsIdentity callerRunAsIdentity = (RunAsIdentity) callerRunAs;
RoleGroup srg = new SimpleRoleGroup(callerRunAsIdentity.getRunAsRoles());
// Check that the run-as role is in the set of method roles
if(srg.containsAtleastOneRole(methodRoles) == false)
{
String method = this.ejbMethod.getName();
String msg = "Insufficient method permissions, principal=" + ejbPrincipal
+ ", ejbName=" + this.ejbName
+ ", method=" + method + ", interface=" + this.methodInterface
+ ", requiredRoles=" + methodRoles + ", runAsRoles="
+ callerRunAsIdentity.getRunAsRoles();
if(trace)
log.trace("Exception:"+msg);
allowed = false;
}