public static int GetUserCount(LocationEntity location) { return(RoleUtils.IsUserAdmin() ? location.UserAssignedLocations.Count : location.UserAssignedLocations.Count(l => !l.User.UserAccountRestrictions.Any())); }