Commit baf626e5 authored by Yorick Peterse's avatar Yorick Peterse

Move EE code out of Gitlab::Access

This moves all EE specific code out of Gitlab::Access and into
EE::Gitlab::Access.
parent f9da5d78
......@@ -33,8 +33,8 @@ module EE
}
when :project_creation_level
{
from: ::EE::Gitlab::Access.level_name(old),
to: ::EE::Gitlab::Access.level_name(new)
from: ::Gitlab::Access.level_name(old),
to: ::Gitlab::Access.level_name(new)
}
when :plan_id
{
......
......@@ -8,23 +8,26 @@
module EE
module Gitlab
module Access
extend self
extend ActiveSupport::Concern
# Default project creation level
NO_ONE_PROJECT_ACCESS = 0
MAINTAINER_PROJECT_ACCESS = 1
DEVELOPER_MAINTAINER_PROJECT_ACCESS = 2
ADMIN = 60
def project_creation_options
{
s_('ProjectCreationLevel|No one') => NO_ONE_PROJECT_ACCESS,
s_('ProjectCreationLevel|Maintainers') => MAINTAINER_PROJECT_ACCESS,
s_('ProjectCreationLevel|Developers + Maintainers') => DEVELOPER_MAINTAINER_PROJECT_ACCESS
}
end
class_methods do
def project_creation_options
{
s_('ProjectCreationLevel|No one') => NO_ONE_PROJECT_ACCESS,
s_('ProjectCreationLevel|Maintainers') => MAINTAINER_PROJECT_ACCESS,
s_('ProjectCreationLevel|Developers + Maintainers') => DEVELOPER_MAINTAINER_PROJECT_ACCESS
}
end
def level_name(name)
project_creation_options.key(name)
def level_name(name)
project_creation_options.key(name)
end
end
end
end
......
......@@ -7,8 +7,6 @@
#
module Gitlab
module Access
extend ::EE::Gitlab::Access # rubocop: disable Cop/InjectEnterpriseEditionModule
AccessDeniedError = Class.new(StandardError)
NO_ACCESS = 0
......@@ -19,7 +17,6 @@ module Gitlab
# @deprecated
MASTER = MAINTAINER
OWNER = 50
ADMIN = 60
# Branch protection settings
PROTECTION_NONE = 0
......@@ -89,3 +86,5 @@ module Gitlab
end
end
end
Gitlab::Access.prepend(EE::Gitlab::Access)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment