}
}
}
SecurityContext sc = SecurityActions.getSecurityContext();
AbstractWebAuthorizationHelper helper = null;
try {
helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
} catch (Exception e) {
WebLogger.WEB_SECURITY_LOGGER.noAuthorizationHelper(e);
}
Subject callerSubject = sc.getUtil().getSubject();
if (callerSubject == null) {
// During hasResourcePermission check, Catalina calls hasRole. But we have not established
// a subject yet in the security context. So we will get the subject from the cached principal
callerSubject = getSubjectFromRequestPrincipal(principal);
}
authzDecision = helper.hasRole(roleName, principal, servletName, getPrincipalRoles(principal),
PolicyContext.getContextID(), callerSubject, getPrincipalRoles(request));
}
boolean finalDecision = baseDecision && authzDecision;
WebLogger.WEB_SECURITY_LOGGER.tracef("hasRole:RealmBase says:" + baseDecision + "::Authz framework says:" + authzDecision + ":final="
+ finalDecision);