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:
Diffstat (limited to 'lib/gitlab/audit/unauthenticated_author.rb')
-rw-r--r--lib/gitlab/audit/unauthenticated_author.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/audit/unauthenticated_author.rb b/lib/gitlab/audit/unauthenticated_author.rb
new file mode 100644
index 00000000000..84c323c1950
--- /dev/null
+++ b/lib/gitlab/audit/unauthenticated_author.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Audit
+ class UnauthenticatedAuthor < Gitlab::Audit::NullAuthor
+ def initialize(name: nil)
+ super(id: -1, name: name)
+ end
+
+ # Events that are authored by unauthenticated users, should be
+ # shown as authored by `An unauthenticated user` in the UI.
+ def name
+ @name || _('An unauthenticated user')
+ end
+ end
+ end
+end