Move Gitlab::Auth.Result to separate file

This commit is contained in:
Kamil Trzcinski 2016-09-19 13:42:10 +02:00
parent abcc0ba570
commit 79f60e2b5c
2 changed files with 17 additions and 14 deletions

View file

@ -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

17
lib/gitlab/auth/result.rb Normal file
View file

@ -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