Skip to content

Refactor add_users method for project and group [EE]

username-removed-444 requested to merge dz-cleanup-add-users-ee into master

EE version of the https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10850

What does this MR do?

  1. Add Member#add_users method to be consistent with Member#add_user
  2. Get rid of specific methods like add_users_to_group and use Member#add_users instead
  3. Don't use ProjectMember.add_users_to_projects when you only need to add members to single project

Are there points in the code the reviewer needs to double check?

no

Why was this MR needed?

Cleanup code spaghetti code around adding users to project/group.

Before:

  • ProjectTeam.add_users -> ProjectMember.add_users_to_projects -> Member.add_users_to_source.
  • Group.add_users -> Group.add_users_to_group -> Member.add_users_to_source

Now:

  • ProjectTeam.add_users -> Member.add_users
  • Group.add_users -> Member.add_users

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/14709

Merge request reports