Commit 9d8afa22 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve code comments

parent eadfc3a1
...@@ -179,7 +179,7 @@ module Ci ...@@ -179,7 +179,7 @@ module Ci
end end
def repo_url def repo_url
auth = "gitlab-ci-token:#{ensure_token}@" auth = "gitlab-ci-token:#{ensure_token!}@"
project.http_url_to_repo.sub(/^https?:\/\//) do |prefix| project.http_url_to_repo.sub(/^https?:\/\//) do |prefix|
prefix + auth prefix + auth
end end
......
...@@ -64,7 +64,7 @@ class ProjectPolicy < BasePolicy ...@@ -64,7 +64,7 @@ class ProjectPolicy < BasePolicy
can! :read_deployment can! :read_deployment
end end
# Permissions given when an user is direct member of a group # Permissions given when an user is team member of a project
def team_member_reporter_access! def team_member_reporter_access!
can! :build_download_code can! :build_download_code
can! :build_read_container_image can! :build_read_container_image
......
...@@ -90,7 +90,7 @@ module Auth ...@@ -90,7 +90,7 @@ module Auth
def build_can_pull?(requested_project) def build_can_pull?(requested_project)
# Build can: # Build can:
# 1. pull from it's own project (for ex. a build) # 1. pull from its own project (for ex. a build)
# 2. read images from dependent projects if creator of build is a team member # 2. read images from dependent projects if creator of build is a team member
@authentication_abilities.include?(:build_read_container_image) && @authentication_abilities.include?(:build_read_container_image) &&
(requested_project == project || can?(current_user, :build_read_container_image, requested_project)) (requested_project == project || can?(current_user, :build_read_container_image, requested_project))
...@@ -102,7 +102,7 @@ module Auth ...@@ -102,7 +102,7 @@ module Auth
end end
def build_can_push?(requested_project) def build_can_push?(requested_project)
# Build can push only to project to from which he originates # Build can push only to the project from which it originates
@authentication_abilities.include?(:build_create_container_image) && @authentication_abilities.include?(:build_create_container_image) &&
requested_project == project requested_project == project
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment