private bool CanSeeUnpublishedContents() { var context = System.Web.HttpContext.Current; if (context == null) { return(false); } string token = context.Request.QueryString["previewToken"]; if (String.IsNullOrEmpty(token)) { return(false); } Core.Services.SecurityService security = new Core.Services.SecurityService(); var admCMS = new Groups.ADM_CMS(); var admSEC = new Core.Groups.ADM_SEC(); Core.User u = security.GetUserByAuthToken(token); if (u == null) { return(false); } string[] roles = security.GetUserRoles(u); return(roles.Contains(admCMS.UserGroupUId) || roles.Contains(admSEC.UserGroupUId)); }
private bool CanSeeUnpublishedContents() { var context = System.Web.HttpContext.Current; if (context == null) return false; string token = context.Request.QueryString["previewToken"]; if (String.IsNullOrEmpty(token)) return false; Core.Services.SecurityService security = new Core.Services.SecurityService(); var admCMS = new Groups.ADM_CMS(); var admSEC = new Core.Groups.ADM_SEC(); Core.User u = security.GetUserByAuthToken(token); if (u == null) return false; string[] roles = security.GetUserRoles(u); return roles.Contains(admCMS.UserGroupUId) || roles.Contains(admSEC.UserGroupUId); }