Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group_api_compatibility.rb « concerns « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f02aa2035e57f42926351ff5d0bd350f2ba8b83b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

# Add methods used by the groups API
module GroupAPICompatibility
  extend ActiveSupport::Concern

  def project_creation_level_str
    ::Gitlab::Access.project_creation_string_options.key(project_creation_level)
  end

  def project_creation_level_str=(value)
    write_attribute(:project_creation_level, ::Gitlab::Access.project_creation_string_options.fetch(value))
  end

  def subgroup_creation_level_str
    ::Gitlab::Access.subgroup_creation_string_options.key(subgroup_creation_level)
  end

  def subgroup_creation_level_str=(value)
    write_attribute(:subgroup_creation_level, ::Gitlab::Access.subgroup_creation_string_options.fetch(value))
  end
end