diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-14 11:46:13 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 15:20:39 +0530 |
commit | cc1cebdcc536244d97bdf6c767c2f1875c71cdf5 (patch) | |
tree | 718a6e1307850e573236c78d0e038162deca30c2 /app/models/protected_branch | |
parent | 4d6dadc8f8af986a0792fb388775a174e76b0b7d (diff) | |
download | gitlab-ce-cc1cebdcc536244d97bdf6c767c2f1875c71cdf5.tar.gz |
Admins count as masters too.
1. In the context of protected branches.
2. Test this behaviour.
Diffstat (limited to 'app/models/protected_branch')
-rw-r--r-- | app/models/protected_branch/merge_access_level.rb | 4 | ||||
-rw-r--r-- | app/models/protected_branch/push_access_level.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/protected_branch/merge_access_level.rb b/app/models/protected_branch/merge_access_level.rb index d536f816317..632e47b028f 100644 --- a/app/models/protected_branch/merge_access_level.rb +++ b/app/models/protected_branch/merge_access_level.rb @@ -13,9 +13,9 @@ class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base def check_access(user) if masters? - user.can?(:push_code, project) if project.team.master?(user) + user.can?(:push_code, project) if project.team.master_or_greater?(user) elsif developers? - user.can?(:push_code, project) if project.team.master?(user) || project.team.developer?(user) + user.can?(:push_code, project) if project.team.developer_or_greater?(user) end end diff --git a/app/models/protected_branch/push_access_level.rb b/app/models/protected_branch/push_access_level.rb index bb46b39b714..35d4ad93231 100644 --- a/app/models/protected_branch/push_access_level.rb +++ b/app/models/protected_branch/push_access_level.rb @@ -14,9 +14,9 @@ class ProtectedBranch::PushAccessLevel < ActiveRecord::Base def check_access(user) if masters? - user.can?(:push_code, project) if project.team.master?(user) + user.can?(:push_code, project) if project.team.master_or_greater?(user) elsif developers? - user.can?(:push_code, project) if project.team.master?(user) || project.team.developer?(user) + user.can?(:push_code, project) if project.team.developer_or_greater?(user) elsif no_one? false end |