Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-16 14:34:05 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-16 14:34:05 +0300
commitf7ae37c1d092f89cd9b9dc24be95670abed16ffc (patch)
tree16a553a15676adaeaf4c1c9f2e9eaf46c9c8c2a8 /lib/gitlab/auth.rb
parent9d8afa222c678a2222f5219458759897089d7dad (diff)
Simplify checking of allowed abilities in git_http_client_controller
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 3d7cc176e07..f9ae5e4543f 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -1,6 +1,14 @@
module Gitlab
module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
+ def ci?
+ type == :ci
+ end
+
+ def lfs_deploy_token?
+ type == :lfs_deploy_token
+ end
+
def success?
actor.present? || type == :ci
end
@@ -143,6 +151,8 @@ module Gitlab
end
end
+ public
+
def build_authentication_abilities
[
:read_project,