private bool CurrentUserHasPermissions(EntityPermissionCollection permissionResults, int nodeId) { //This is done for us in 7.7.2 var perms = permissionResults.Where(x => x.EntityId == nodeId).SelectMany(x => x.AssignedPermissions).Distinct().ToArray(); return(perms.Any(x => x == "F")); }
private bool HasPermissions(EntityPermissionCollection permissionResults, int nodeId) { var forNode = permissionResults.Where(x => x.EntityId == nodeId).ToList(); var permissions = forNode.SelectMany(x => x.AssignedPermissions).ToList(); return(permissions.Contains("F")); }