Prevent group owners from deleting project runners that are related to other projects
Part of #336405 (closed), blocks #19819 (closed)
The following discussion from !81904 (merged) should be addressed:
-
@mrincon started a discussion: Issue: While working on this MR I realized the some runners should not be available for removal by group owners. I'll open a follow I issue.
Current Implementation
Currently, our Group Runners UI has the following check:
- if runner.belongs_to_more_than_one_project?
- delete_runner_tooltip = _('Multi-project Runners cannot be removed')
...
This is done to prevent project runners in the group view from being removed accidentally while they are still added to other project.
Expected Outcome
We should return canDelete: false
in our GraphQL for runners that:
- Are read by group owners because they are group owners (and not admins) and that,
- Are related to more than one project.
Edited by Miguel Rincon