Skip to content

Hide delete button if no permissions to delete an artifact

Details

The artifact page disables the delete button for anyone who is not maintainer+ roles. If I'm a developer, I will never be able to delete artifacts unless I somehow am given maintainer+ permissions, which would likely never happen.

Proposal

Hide the delete button for anyone who is not maintainer+, including the delete all artifacts in the job and individual job artifact deletion. (note: this proposal design includes disabled buttons for expired artifacts, which can be a separate iteration)

Current Proposed
Screen_Shot_2022-11-09_at_10.58.48_AM Screen_Shot_2022-11-09_at_11.14.13_AM

Technical proposal

Add another bit of data to #js-artifact-management: "can-delete-artifacts" => can?(current_user, :destroy_artifacts, @project).to_s, provide it to vue here, add v-ifs to the delete buttons that depend on it.

Edited by Miranda Fluharty