SecurityConstraint[] constraints, Context context) throws IOException
{
boolean isAuthorized = super.hasResourcePermission(request, response,
constraints, context);
log.debug("Super class has authorized="+isAuthorized);
AuthorizationManager authzManager = null;
try
{
authzManager = this.getAuthorizationManager();
}
catch(Exception e)
{
log.error("Error obtaining Authorization Manager:",e);
}
final HashMap map = new HashMap();
map.put("catalina.request",request);
map.put("catalina.constraints",constraints);
map.put("catalina.context", context);
map.put("authorizationManager",authzManager);
WebResource resource = new WebResource(map);
try
{
int check = authzManager.authorize(resource);
isAuthorized = (check == AuthorizationContext.PERMIT);
}
catch (Exception e)
{
isAuthorized = false;