diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-16 13:34:05 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-16 13:34:05 +0200 |
commit | f7ae37c1d092f89cd9b9dc24be95670abed16ffc (patch) | |
tree | 16a553a15676adaeaf4c1c9f2e9eaf46c9c8c2a8 /lib | |
parent | 9d8afa222c678a2222f5219458759897089d7dad (diff) | |
download | gitlab-ce-f7ae37c1d092f89cd9b9dc24be95670abed16ffc.tar.gz |
Simplify checking of allowed abilities in git_http_client_controller
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/auth.rb | 10 |
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, |