if(methodRoles.containsRole(SimpleRole.ANYBODY_ROLE))
return AuthorizationContext.PERMIT;
for(Principal p : subject.getPrincipals())
{
// TODO: not really true, but for the moment lets assume that the principal is also the role
Role myRole = new SimpleRole(p.getName());
if(methodRoles.containsRole(myRole))
return AuthorizationContext.PERMIT;
}
return AuthorizationContext.DENY;
}