summaryrefslogtreecommitdiff
path: root/app/policies/project_policy.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 10:34:53 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 10:34:53 +0200
commit6b381f3fdf00c7eeb971f365bde2a41f0cecf944 (patch)
treeb3e661a6dc8a75149889b4a8aa7b4d7fbdb7369b /app/policies/project_policy.rb
parent79e4bb8d0b3b74ddd185677e4828d737788c3b1a (diff)
downloadgitlab-ce-6b381f3fdf00c7eeb971f365bde2a41f0cecf944.tar.gz
Use `build_read_container_image` and use `build_download_code`
Diffstat (limited to 'app/policies/project_policy.rb')
-rw-r--r--app/policies/project_policy.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index cda83bcc74a..ce686af2ade 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -65,9 +65,9 @@ class ProjectPolicy < BasePolicy
end
# Permissions given when an user is direct member of a group
- def restricted_reporter_access!
- can! :restricted_download_code
- can! :restricted_read_container_image
+ def team_member_reporter_access!
+ can! :build_download_code
+ can! :build_read_container_image
end
def developer_access!
@@ -115,6 +115,8 @@ class ProjectPolicy < BasePolicy
can! :read_commit_status
can! :read_pipeline
can! :read_container_image
+ can! :build_download_code
+ can! :build_read_container_image
end
def owner_access!
@@ -136,11 +138,11 @@ 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
- restricted_reporter_access! if access >= Gitlab::Access::REPORTER
- developer_access! if access >= Gitlab::Access::DEVELOPER
- master_access! if access >= Gitlab::Access::MASTER
+ 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
end
def archived_access!