diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-09-21 02:09:31 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-10-06 18:54:28 -0300 |
commit | 1d35c5b3aed565f1da0fc696f078642540584ce0 (patch) | |
tree | 276f7d002f40ef342af9d720ba2fd1f815247b16 /app/policies | |
parent | 9a13f885a9dc7b072d41160a6d3db965c9114b4b (diff) | |
download | gitlab-ce-1d35c5b3aed565f1da0fc696f078642540584ce0.tar.gz |
Improve project policy spec
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_policy.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index be25c750d67..a806cf83782 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -98,7 +98,6 @@ class ProjectPolicy < BasePolicy can! :admin_milestone can! :admin_project_snippet can! :admin_project_member - can! :admin_merge_request can! :admin_note can! :admin_wiki can! :admin_project @@ -139,11 +138,18 @@ class ProjectPolicy < BasePolicy def team_access!(user) access = project.team.max_member_access(user.id) - guest_access! if access >= Gitlab::Access::GUEST - reporter_access! if access >= Gitlab::Access::REPORTER - team_member_reporter_access! if access >= Gitlab::Access::REPORTER - developer_access! if access >= Gitlab::Access::DEVELOPER - master_access! if access >= Gitlab::Access::MASTER + return if access < Gitlab::Access::GUEST + guest_access! + + return if access < Gitlab::Access::REPORTER + reporter_access! + team_member_reporter_access! + + return if access < Gitlab::Access::DEVELOPER + developer_access! + + return if access < Gitlab::Access::MASTER + master_access! end def archived_access! |