summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-08-30 11:12:09 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-08-30 11:39:22 -0700
commitd7bd20099bb9df677cf272a5b211fbe9c330c619 (patch)
tree84b2ad80015c86af62a564bd37adeb35d4e16750 /app/policies
parent71765536d0c29e64eb24ce50da9d5fdfc63f9e78 (diff)
downloadgitlab-ce-d7bd20099bb9df677cf272a5b211fbe9c330c619.tar.gz
use a more compact style for access policies
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/project_policy.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index 8a1148dece4..54f5f95cd65 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -130,17 +130,10 @@ class ProjectPolicy < BasePolicy
def team_access!(user)
access = project.team.max_member_access(user.id)
- return if access < Gitlab::Access::GUEST
- guest_access!
-
- return if access < Gitlab::Access::REPORTER
- reporter_access!
-
- return if access < Gitlab::Access::DEVELOPER
- developer_access!
-
- return if access < Gitlab::Access::MASTER
- master_access!
+ guest_access! if access >= Gitlab::Access::GUEST
+ reporter_access! if access >= Gitlab::Access::REPORTER
+ developer_access! if access >= Gitlab::Access::DEVELOPER
+ master_access! if access >= Gitlab::Access::MASTER
end
def archived_access!