diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 14:42:10 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 14:42:10 +0300 |
commit | 79f60e2b5cf388416cdc5948e19ae0401f97d353 (patch) | |
tree | ac9f72416efc4cdfdf509aa08b3608ff5a9ccc9f | |
parent | abcc0ba57027026cb5bb074b8691510a24724958 (diff) |
Move Gitlab::Auth.Result to separate file
-rw-r--r-- | lib/gitlab/auth.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/auth/result.rb | 17 |
2 files changed, 17 insertions, 14 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 1e0a7ec253a..ca2a0920c00 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -1,19 +1,5 @@ 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 - end - class MissingPersonalTokenError < StandardError; end class << self diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb new file mode 100644 index 00000000000..e4786b12676 --- /dev/null +++ b/lib/gitlab/auth/result.rb @@ -0,0 +1,17 @@ +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 + end + end +end |