<commit_before>package org.gbif.registry.ws.security;

import org.gbif.api.model.registry.Dataset;
import org.gbif.api.model.registry.Installation;
import org.gbif.api.model.registry.Organization;
import org.gbif.api.service.registry.DatasetService;
import org.gbif.api.service.registry.InstallationService;
import org.gbif.api.service.registry.OrganizationService;
import org.gbif.registry.persistence.mapper.UserRightsMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Primary;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
@Primary
public class EditorAuthorizationServiceImpl implements EditorAuthorizationService {
  private static final Logger LOG = LoggerFactory.getLogger(EditorAuthorizationServiceImpl.class);

  private UserRightsMapper userRightsMapper;
  private DatasetService datasetService;
  private InstallationService installationService;
  private OrganizationService organizationService;

  public EditorAuthorizationServiceImpl(DatasetService datasetService,
                                        InstallationService installationService,
                                        OrganizationService organizationService,
                                        UserRightsMapper userRightsMapper) {
    this.datasetService = datasetService;<commit_msg>EditorAuthorizationService temp fix circular dependency<commit_after>package org.gbif.registry.ws.security;

import org.gbif.api.model.registry.Dataset;
import org.gbif.api.model.registry.Installation;
import org.gbif.api.model.registry.Organization;
import org.gbif.api.service.registry.DatasetService;
import org.gbif.api.service.registry.InstallationService;
import org.gbif.api.service.registry.OrganizationService;
import org.gbif.registry.persistence.mapper.UserRightsMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
@Primary
public class EditorAuthorizationServiceImpl implements EditorAuthorizationService {

  private static final Logger LOG = LoggerFactory.getLogger(EditorAuthorizationServiceImpl.class);

  private UserRightsMapper userRightsMapper;
  private DatasetService datasetService;
  private InstallationService installationService;
  private OrganizationService organizationService;

  // TODO: 06/09/2019 fix problem with services (circular dependency). Optional lazy dependency for now
  public EditorAuthorizationServiceImpl(@Lazy @Autowired(required = false) DatasetService datasetService,
                                        @Lazy @Autowired(required = false) InstallationService installationService,
                                        @Lazy @Autowired(required = false) OrganizationService organizationService,
                                        UserRightsMapper userRightsMapper) {
    this.datasetService = datasetService;
{'fraction_non_alphanumeric': 0.06994738471061591, 'fraction_numerical': 0.003714020427112349, 'mean_word_length': 4.496598639455782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3234263', 'n_tokens_mistral': 767, 'n_tokens_neox': 780, 'n_words': 157}