Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-17 21:10:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-17 21:10:35 +0300
commit4484c8523126ee1de864bbcac43c706252d580be (patch)
tree5dff926e0deb8d55ce79c7c563f8fa7b1706a128 /lib/gitlab/auth
parent20dbd96076a6d09d20a9ac3caa1f35506d82340b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r--lib/gitlab/auth/result.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb
index 1b1505c46bd..69525a281e9 100644
--- a/lib/gitlab/auth/result.rb
+++ b/lib/gitlab/auth/result.rb
@@ -2,8 +2,17 @@
module Gitlab
module Auth
- Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
- self::EMPTY = self.new(nil, nil, nil, nil).freeze
+ class Result
+ attr_reader :actor, :project, :type, :authentication_abilities
+
+ def initialize(actor, project, type, authentication_abilities)
+ @actor = actor
+ @project = project
+ @type = type
+ @authentication_abilities = authentication_abilities
+ end
+
+ EMPTY = self.new(nil, nil, nil, nil).freeze
def ci?(for_project)
type == :ci &&
@@ -27,6 +36,7 @@ module Gitlab
def auth_user
actor.is_a?(User) ? actor : nil
end
+ alias_method :user, :auth_user
def deploy_token
actor.is_a?(DeployToken) ? actor : nil