summaryrefslogtreecommitdiff
path: root/app/services/protected_branches
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-07-11 14:36:08 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-11 14:36:08 +0000
commita63bce1a4b55bc6cbafb9dec12d33028521489e9 (patch)
treeee9466e6b06536a65d4e851f4096679c6f968d1e /app/services/protected_branches
parent1bf54e092783f7ad388225d32ab79ac1e845559c (diff)
downloadgitlab-ce-a63bce1a4b55bc6cbafb9dec12d33028521489e9.tar.gz
Resolve "Rename the `Master` role to `Maintainer`" Backend
Diffstat (limited to 'app/services/protected_branches')
-rw-r--r--app/services/protected_branches/access_level_params.rb2
-rw-r--r--app/services/protected_branches/legacy_api_create_service.rb4
-rw-r--r--app/services/protected_branches/legacy_api_update_service.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/app/services/protected_branches/access_level_params.rb b/app/services/protected_branches/access_level_params.rb
index 253ae8b0124..4658b0e850d 100644
--- a/app/services/protected_branches/access_level_params.rb
+++ b/app/services/protected_branches/access_level_params.rb
@@ -14,7 +14,7 @@ module ProtectedBranches
private
def params_with_default(params)
- params[:"#{type}_access_level"] ||= Gitlab::Access::MASTER if use_default_access_level?(params)
+ params[:"#{type}_access_level"] ||= Gitlab::Access::MAINTAINER if use_default_access_level?(params)
params
end
diff --git a/app/services/protected_branches/legacy_api_create_service.rb b/app/services/protected_branches/legacy_api_create_service.rb
index e358fd0374e..bb7656489c5 100644
--- a/app/services/protected_branches/legacy_api_create_service.rb
+++ b/app/services/protected_branches/legacy_api_create_service.rb
@@ -9,14 +9,14 @@ module ProtectedBranches
if params.delete(:developers_can_push)
Gitlab::Access::DEVELOPER
else
- Gitlab::Access::MASTER
+ Gitlab::Access::MAINTAINER
end
merge_access_level =
if params.delete(:developers_can_merge)
Gitlab::Access::DEVELOPER
else
- Gitlab::Access::MASTER
+ Gitlab::Access::MAINTAINER
end
@params.merge!(push_access_levels_attributes: [{ access_level: push_access_level }],
diff --git a/app/services/protected_branches/legacy_api_update_service.rb b/app/services/protected_branches/legacy_api_update_service.rb
index 33176253ca2..1df38de0e4a 100644
--- a/app/services/protected_branches/legacy_api_update_service.rb
+++ b/app/services/protected_branches/legacy_api_update_service.rb
@@ -17,14 +17,14 @@ module ProtectedBranches
when true
params[:push_access_levels_attributes] = [{ access_level: Gitlab::Access::DEVELOPER }]
when false
- params[:push_access_levels_attributes] = [{ access_level: Gitlab::Access::MASTER }]
+ params[:push_access_levels_attributes] = [{ access_level: Gitlab::Access::MAINTAINER }]
end
case @developers_can_merge
when true
params[:merge_access_levels_attributes] = [{ access_level: Gitlab::Access::DEVELOPER }]
when false
- params[:merge_access_levels_attributes] = [{ access_level: Gitlab::Access::MASTER }]
+ params[:merge_access_levels_attributes] = [{ access_level: Gitlab::Access::MAINTAINER }]
end
service = ProtectedBranches::UpdateService.new(@project, @current_user, @params)