diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-20 11:24:47 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-20 12:03:10 +0300 |
commit | 795acf2e4e01f7ddf3a8be73ddc119b4d84a03e3 (patch) | |
tree | 1734323e1a55b7be520e79d7e1f40acaad438456 /lib/gitlab/auth | |
parent | 242e77e070c25fd45896bdd7be6edac4679ec2b2 (diff) |
Move logic to check ci? or lfs_deploy_token? to Gitlab::Auth::Result
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r-- | lib/gitlab/auth/result.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb index e4786b12676..6be7f690676 100644 --- a/lib/gitlab/auth/result.rb +++ b/lib/gitlab/auth/result.rb @@ -1,12 +1,16 @@ module Gitlab module Auth Result = Struct.new(:actor, :project, :type, :authentication_abilities) do - def ci? - type == :ci + def ci?(for_project) + type == :ci && + project && + project == for_project end - def lfs_deploy_token? - type == :lfs_deploy_token + def lfs_deploy_token?(for_project) + type == :lfs_deploy_token && + actor && + actor.projects.include?(for_project) end def success? |