@SuppressWarnings("unchecked")
private boolean isAuthorized(HttpServletRequest req, String action)
{
boolean isAuthorized = false;
Authorizer authorizer = (Authorizer)WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean("authorizer");
User user = new User();
user.setUsername((String)req.getSession().getAttribute(Constants.SESSION_KEY_USERNAME));
user.setRoles((Set<Constants.Role>)req.getSession().getAttribute(Constants.SESSION_KEY_ROLES));
try
{
isAuthorized = authorizer.isAuthorized(user, action);
}
catch (Exception e)
{
isAuthorized = false;
}