Skip to content

Refactor audit events for Users services

What does this MR do and why?

Adds audit event types for User services. Refactors associated API helpers to use Gitlab::Audit::Auditor to build audit events.

This affects the following services:

  • ee/app/services/ee/users/create_service.rb
  • ee/app/services/ee/users/destroy_service.rb
  • ee/app/services/ee/users/approve_service.rb
  • ee/app/services/ee/users/reject_service.rb
  • ee/app/services/ee/users/block_service.rb

Verification

These services can be triggered through actions in Admin > Overview > Users:

  1. Create a user using the "New User" button.
  2. Delete a user (this may take a while to process).
  3. Block a user.

The above should each generate an audit event. To trigger approve/reject events, register a new user in the login page, then accept or reject that user through the admin role.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #374107 (closed)

Edited by Aaron Huntsman

Merge request reports