diff options
author | Phil Hughes <me@iamphill.com> | 2017-05-10 09:46:50 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-10 17:19:40 +0100 |
commit | 025a1b01758662fed033380d3ae69149d2966e0c (patch) | |
tree | ccc48f3a456d47ffd2f14ff0766a9c7038aa007b /app/models/protected_branch | |
parent | 566ee14516ac54e52c4dfaf40d10bc5f2abc3627 (diff) | |
download | gitlab-ce-025a1b01758662fed033380d3ae69149d2966e0c.tar.gz |
Enabled no-one as a merge access level in protected branches
Closes #31541
Diffstat (limited to 'app/models/protected_branch')
-rw-r--r-- | app/models/protected_branch/merge_access_level.rb | 10 | ||||
-rw-r--r-- | app/models/protected_branch/push_access_level.rb | 18 |
2 files changed, 0 insertions, 28 deletions
diff --git a/app/models/protected_branch/merge_access_level.rb b/app/models/protected_branch/merge_access_level.rb index 771e3376613..e8d35ac326f 100644 --- a/app/models/protected_branch/merge_access_level.rb +++ b/app/models/protected_branch/merge_access_level.rb @@ -1,13 +1,3 @@ class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base include ProtectedBranchAccess - - validates :access_level, presence: true, inclusion: { in: [Gitlab::Access::MASTER, - Gitlab::Access::DEVELOPER] } - - def self.human_access_levels - { - Gitlab::Access::MASTER => "Masters", - Gitlab::Access::DEVELOPER => "Developers + Masters" - }.with_indifferent_access - end end diff --git a/app/models/protected_branch/push_access_level.rb b/app/models/protected_branch/push_access_level.rb index 14610cb42b7..7a2e9e5ec5d 100644 --- a/app/models/protected_branch/push_access_level.rb +++ b/app/models/protected_branch/push_access_level.rb @@ -1,21 +1,3 @@ class ProtectedBranch::PushAccessLevel < ActiveRecord::Base include ProtectedBranchAccess - - validates :access_level, presence: true, inclusion: { in: [Gitlab::Access::MASTER, - Gitlab::Access::DEVELOPER, - Gitlab::Access::NO_ACCESS] } - - def self.human_access_levels - { - Gitlab::Access::MASTER => "Masters", - Gitlab::Access::DEVELOPER => "Developers + Masters", - Gitlab::Access::NO_ACCESS => "No one" - }.with_indifferent_access - end - - def check_access(user) - return false if access_level == Gitlab::Access::NO_ACCESS - - super - end end |