diff options
author | Kerri Miller <kerrizor@kerrizor.com> | 2019-09-05 13:01:36 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-05 13:01:36 +0000 |
commit | 0e40b41e224f18076426578da08548ae22afdcd1 (patch) | |
tree | 3bf58eb8e415771f28270910a66672b4d9db87b9 /app/services/protected_branches | |
parent | 95ef27253909ba7ff30667af14f7ea2256c1ae8d (diff) | |
download | gitlab-ce-0e40b41e224f18076426578da08548ae22afdcd1.tar.gz |
Add structure to support EE feature of COAR
These are the structural changes for supporting the EE feature of moving
"code_owner_approval_required" state from existing on a project to being
on the protected branches individually, allowing for CODEOWNER
validation on push events.
Diffstat (limited to 'app/services/protected_branches')
-rw-r--r-- | app/services/protected_branches/create_service.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/protected_branches/create_service.rb b/app/services/protected_branches/create_service.rb index 87aaf4672a4..6b2836bba39 100644 --- a/app/services/protected_branches/create_service.rb +++ b/app/services/protected_branches/create_service.rb @@ -5,7 +5,8 @@ module ProtectedBranches def execute(skip_authorization: false) raise Gitlab::Access::AccessDeniedError unless skip_authorization || authorized? - protected_branch.save + save_protected_branch + protected_branch end @@ -15,6 +16,10 @@ module ProtectedBranches private + def save_protected_branch + protected_branch.save + end + def protected_branch @protected_branch ||= project.protected_branches.new(params) end |