Fix adding flows to projects when group or instance has disabled member invites
What does this MR do and why?
Fix adding flows when group has disabled invites.
In Allow adding flows to projects with a group mem... (!223735 - merged) I fixed an error where when having the "Users cannot be added to projects in this group." setting enabled in a TLG, you could not add flows to projects.
However, it wasn't a complete fix, since there is another setting disable_invite_members which on SaaS can be enabled in a group, and on dedicated/self-managed can be enabled instance wide, that would cause the same issue.
This MR fixes that setting as well.
EE: true Changelog: fixed
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
Note: You must run these tests as a non-admin user, as an admin is still allowed to add members.
- Without SaaS mode
- Go to the admin settings and enable "Prevent group/project member invitations"
- On SaaS mode
- Go to Settings > General > Permissions and group features and enable "Disable user invitations to groups and projects within " (e.g.
gitlab-duo)
- Go to Settings > General > Permissions and group features and enable "Disable user invitations to groups and projects within " (e.g.
- Go to http://gdk.test:8080/gitlab-duo/test/-/automate/flows and create a flow
- Go to http://gdk.test:8080/explore/ai-catalog/flows and add the flow to the
gitlab-duogroup - Go back to the project http://gdk.test:8080/gitlab-duo/test/-/automate/flows and add the flow to the project with the "Enable flow from group" button. This should work on this branch, but not master
- Try adding a regular user to the project. This should still fail. (the UI won't let you try this, run
Project.find(19).team.add_member(User.find_by_username("knejad2"), :reporter))
Related to #577607
Edited by Keeyan Nejad