Hide delete button when user cannot delete runner
What does this MR do and why?
This change hides the delete button when users cannot delete the corresponding runner instead of showing it disabled.
Initially we assumed that users would only be prevented from deleting when multiple projects were linked to a runner. However, now that we are allowing users to see shared runners they may see more general information about runners they cannot delete.
See related comment by @gdoyle
Changelog: changed
Screenshots or screen recordings
before | after |
---|---|
How to set up and validate locally
Using two users is the easiest way to test this:
- As root we wil create a Project runner that's assigned to multiple projects:
- Register a Project runner (Visit a project in a group e.g.
http://gdk.test:3000/top-group/top-project/-/settings/ci_cd
) and create a runner. - Visit the Admin area and edit the runner (e.g.
http://gdk.test:3000/admin/runners/1
) - Assign the runner to more than one project
- Register a Project runner (Visit a project in a group e.g.
- Log in as a group owner to view the previous project runner, without a delete button.
- Don't use the root user, the root user can always delete runners!
- As a group owner, of the group that owns the project
http://gdk.test:3000/top-group/
- Visit the Runner admin (e.g.
http://gdk.test:3000/top-group/-/runners
) - Locate the Project Runner, confirm the button is not present
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #337838 (closed)
Edited by Miguel Rincon