summaryrefslogtreecommitdiff
path: root/app/models/protected_branch.rb
diff options
context:
space:
mode:
authorKerri Miller <kerrizor@kerrizor.com>2019-09-05 13:01:36 +0000
committerNick Thomas <nick@gitlab.com>2019-09-05 13:01:36 +0000
commit0e40b41e224f18076426578da08548ae22afdcd1 (patch)
tree3bf58eb8e415771f28270910a66672b4d9db87b9 /app/models/protected_branch.rb
parent95ef27253909ba7ff30667af14f7ea2256c1ae8d (diff)
downloadgitlab-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/models/protected_branch.rb')
-rw-r--r--app/models/protected_branch.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index ee0c94c20af..9fd929371f8 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -3,6 +3,9 @@
class ProtectedBranch < ApplicationRecord
include ProtectedRef
+ scope :requiring_code_owner_approval,
+ -> { where(code_owner_approval_required: true) }
+
protected_ref_access_levels :merge, :push
def self.protected_ref_accessible_to?(ref, user, project:, action:, protected_refs: nil)