private bool CheckRole(IRoles roles, string roleName, IAuthentication authentication) { var userRoles = roles.GetRolesForCurrentUser().Select(r => r.Name).ToList(); if ((!authentication.IsAuthenticated || !userRoles.Contains(roleName)) && !roles.CurrentUserIsInRoles(RoleNames.Administrators)) { return(false); } return(true); }