Skip to content

Hide delete button when user cannot delete runner

Miguel Rincon requested to merge 337838-hide-delete-button into master

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
image image
image image

How to set up and validate locally

Using two users is the easiest way to test this:

  1. As root we wil create a Project runner that's assigned to multiple projects:
    1. 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.
    2. Visit the Admin area and edit the runner (e.g. http://gdk.test:3000/admin/runners/1)
    3. Assign the runner to more than one project
  2. Log in as a group owner to view the previous project runner, without a delete button.
    1. Don't use the root user, the root user can always delete runners!
    2. As a group owner, of the group that owns the project http://gdk.test:3000/top-group/
    3. Visit the Runner admin (e.g. http://gdk.test:3000/top-group/-/runners)
    4. 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.

Related to #337838 (closed)

Edited by Miguel Rincon

Merge request reports

Loading