blob: 0fe91f9f3c8357691fe4ac46e8d85b792462b31d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# frozen_string_literal: true
module Gitlab
module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
prepend_if_ee('::EE::Gitlab::Auth::Result') # rubocop: disable Cop/InjectEnterpriseEditionModule
def ci?(for_project)
type == :ci &&
project &&
project == for_project
end
def lfs_deploy_token?(for_project)
type == :lfs_deploy_token &&
actor.try(:has_access_to?, for_project)
end
def success?
actor.present? || type == :ci
end
def failed?
!success?
end
end
end
end
|