{
if(authenticatedSubject == null)
return null;
//Ask the CBH for the SecurityContext
SecurityContextCallback scb = new SecurityContextCallback();
try
{
cbh.handle(new Callback[]{scb});
}
catch (Exception e)
{
log.trace("Exception in getSubjectRoles:",e);
throw new RuntimeException(e);
}
SecurityContext sc = scb.getSecurityContext();
Group roles = this.getCurrentRoles(null, authenticatedSubject, sc);
if(roles == null)
return new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
else
return new SimpleRoleGroup(roles);