diff options
Diffstat (limited to 'app/models/concerns/has_user_type.rb')
-rw-r--r-- | app/models/concerns/has_user_type.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/models/concerns/has_user_type.rb b/app/models/concerns/has_user_type.rb index b02c95c9662..0b1c6780db8 100644 --- a/app/models/concerns/has_user_type.rb +++ b/app/models/concerns/has_user_type.rb @@ -14,8 +14,10 @@ module HasUserType migration_bot: 7, security_bot: 8, automation_bot: 9, + security_policy_bot: 10, # Currently not in use. See https://gitlab.com/gitlab-org/gitlab/-/issues/384174 admin_bot: 11, - suggested_reviewers_bot: 12 + suggested_reviewers_bot: 12, + service_account: 13 }.with_indifferent_access.freeze BOT_USER_TYPES = %w[ @@ -26,11 +28,15 @@ module HasUserType migration_bot security_bot automation_bot + security_policy_bot admin_bot suggested_reviewers_bot + service_account ].freeze - NON_INTERNAL_USER_TYPES = %w[human project_bot service_user].freeze + # `service_account` allows instance/namespaces to configure a user for external integrations/automations + # `service_user` is an internal, `gitlab-com`-specific user type for integrations like suggested reviewers + NON_INTERNAL_USER_TYPES = %w[human project_bot service_user service_account].freeze INTERNAL_USER_TYPES = (USER_TYPES.keys - NON_INTERNAL_USER_TYPES).freeze included do @@ -53,10 +59,8 @@ module HasUserType BOT_USER_TYPES.include?(user_type) end - # The explicit check for project_bot will be removed with Bot Categorization - # Ref: https://gitlab.com/gitlab-org/gitlab/-/issues/213945 def internal? - ghost? || (bot? && !project_bot?) + INTERNAL_USER_TYPES.include?(user_type) end def redacted_name(viewing_user) |