Skip to content

Smriti 521362/application setting to disable invite users

What does this MR do and why?

Solves #521362 (closed)

References

Added new application setting for disabling Invite members to the group by group owners.

Screenshots

  1. Settings introduced for Instance admin Screenshot_2025-05-06_at_12.29.32_AM

  2. Project page when user does not have ability to Invite users

Screenshot_2025-05-05_at_1.30.33_PM

  1. Group page when user does not have ability to invite users

Screenshot_2025-05-05_at_1.32.35_PM

Steps to test this feaure

  1. Login to your local installation gdk.test as admin owner and enable setting Prevent group member invitations under Settings> General> Visibility and access controls
  2. Access group members page as group owner https://gdk.test:3443/groups/<group_name>/-/group_members You should observe that buttons Invite members and Invite a group are not visible
  3. Access group members page as instance admin and invite buttons are visible again.

Continue testing by disabling the application setting and button reappearing on the screen again.

Steps to test API

  1. Create an access token as owner of the group
  2. Use the following curl API call with the admin setting Prevent group member invitations disabled -
curl --request POST --header "PRIVATE-TOKEN: <access_token>" \                             
     --data "email=test@example.com&user_id=2&access_level=30" "https://gdk.test:3443/api/v4/groups/<:id>/invitations" -k

curl --request POST --header "PRIVATE-TOKEN: <access_token>" \                             
     --data "email=test@example.com&user_id=2&access_level=30" "https://gdk.test:3443/api/v4/projects/<:id>/invitations" -k

This curl command should work and returns success as status

  1. Use the curl command with admin setting Prevent group member invitations enabled -

The curl command returns 403 Forbidden error

This MR lacks documentation updates. To limit the scope of this MR and get the one wrapped up quick I am raising another MR for updating the documentation related with this change. -!190273 (merged)

Edited by Smriti Garg

Merge request reports

Loading