diff options
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, |