hunk.code_window:         Set<Policy> policySet = user.getPolicies().stream()
                   .filter(policy ->
                           policy.getPermission().equals(MANAGE_USERS.getValue()) ||
                                   policy.getPermission().equals(USER_MANAGE_ORGANIZATIONS.getValue())
                   ).collect(Collectors.toSet());
           return policyGenerator.getAllChildPolicies(user, policySet, User.class);
       }
       /**
        * This function creates a new user in the system. Primarily used by new users signing up for the first time on the
        * platform. This flow also ensures that a personal workspace name is created for the user. The new user is then
  
hunk.labels: keep replace replace replace replace replace replace replace keep keep keep keep keep
hunk.after_edit:         return new HashSet<>(userPolicies.values());
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserServiceImpl.java
hunk.type: replace
file: package com.appsmith.server.services;
  
  import com.appsmith.server.domains.Setting;
  import com.appsmith.server.repositories.SettingRepository;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
  import org.springframework.data.mongodb.core.convert.MongoConverter;
  import org.springframework.stereotype.Service;
  import reactor.core.publisher.Mono;
  import reactor.core.scheduler.Scheduler;
  
  import javax.validation.Validator;
  
  @Service
  public class SettingServiceImpl extends BaseService<SettingRepository, Setting, String> implements SettingService {
  
      private final SettingRepository repository;
  
      @Autowired
      public SettingServiceImpl(Scheduler scheduler,
                                Validator validator,
                                MongoConverter mongoConverter,
                                ReactiveMongoTemplate reactiveMongoTemplate,
                                SettingRepository repository,
                                AnalyticsService analyticsService) {
          super(scheduler, validator, mongoConverter, reactiveMongoTemplate, repository, analyticsService);
          this.repository = repository;
      }
  
      @Override
      public Mono<Setting> getByKey(String key) {
          return repository.findByKey(key);
      }
  }
  