summaryrefslogtreecommitdiff
path: root/app/services/protected_branches/api_create_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/protected_branches/api_create_service.rb')
-rw-r--r--app/services/protected_branches/api_create_service.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/app/services/protected_branches/api_create_service.rb b/app/services/protected_branches/api_create_service.rb
deleted file mode 100644
index f2040dfa03a..00000000000
--- a/app/services/protected_branches/api_create_service.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
-# flags for backward compatibility, and so performs translation between that format and the
-# internal data model (separate access levels). The translation code is non-trivial, and so
-# lives in this service.
-module ProtectedBranches
- class ApiCreateService < BaseService
- def execute
- push_access_level =
- if params.delete(:developers_can_push)
- Gitlab::Access::DEVELOPER
- else
- Gitlab::Access::MASTER
- end
-
- merge_access_level =
- if params.delete(:developers_can_merge)
- Gitlab::Access::DEVELOPER
- else
- Gitlab::Access::MASTER
- end
-
- @params.merge!(push_access_levels_attributes: [{ access_level: push_access_level }],
- merge_access_levels_attributes: [{ access_level: merge_access_level }])
-
- service = ProtectedBranches::CreateService.new(@project, @current_user, @params)
- service.execute
- end
- end
-end