{
return false;
}
}
RollerSession rses = RollerSession.getRollerSession(req);
RollerRequest rreq = RollerRequest.getRollerRequest(req);
boolean ret = true;
if (rses != null && rses.isGlobalAdminUser()) return true;
// next, make sure that users role permits it
if (mRoles != null && mRoles.size() > 0)
{
ret = false;
Iterator roles = mRoles.iterator();
while (roles.hasNext())
{
String role = (String)roles.next();
if (req.isUserInRole(role) || role.equals("any"))
{
ret = true;
break;
}
}
}
// finally make sure that user has required website permissions
if (ret && mPerms != null && mPerms.size() > 0)
{
UserData user = null;
if (rses != null) user = rses.getAuthenticatedUser();
WebsiteData website = rreq.getWebsite();
BasePageModel pageModel = (BasePageModel)req.getAttribute("model");
if (pageModel != null)
{
website = pageModel.getWebsite();
}