1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #5132 from mabashian/4980-job-details-delete

Hide delete button on job details from users without proper permissions

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-10-29 01:18:50 +00:00 committed by GitHub
commit ff1c96b0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,13 +272,15 @@ function JobDetail({ job, i18n, history }) {
)}
</LaunchButton>
)}
<Button
variant="danger"
aria-label={i18n._(t`Delete`)}
onClick={() => setIsDeleteModalOpen(true)}
>
{i18n._(t`Delete`)}
</Button>
{job.summary_fields.user_capabilities.delete && (
<Button
variant="danger"
aria-label={i18n._(t`Delete`)}
onClick={() => setIsDeleteModalOpen(true)}
>
{i18n._(t`Delete`)}
</Button>
)}
</ActionButtonWrapper>
{isDeleteModalOpen && (
<AlertModal
@ -299,6 +301,7 @@ function JobDetail({ job, i18n, history }) {
>
{i18n._(t`Cancel`)}
</Button>
<Button
variant="danger"
aria-label={i18n._(t`Delete`)}