Skip to content

Accept user param for the member activate service

Nicolas Dular requested to merge nd/accept-user-for-activating-members into master

What does this MR do and why?

This modifies the Members::ActivateService to also accept a user and modify all membership states of the user for the group and projects within the group. This is required for an API that will be used on the UsageQuota page to toggle membership states per user.

Related Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/352638

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

bin/rails c
group = Group.first
member = group.members.last
user = member.user

member.wait
member.awaiting? # => true

Members::ActivateService.new(group, current_user: User.first, user: user).execute

member.reload
member.awaiting? # => false

MR acceptance checklist

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

Merge request reports