3
0
Fork 0

fix: hide CRUD header buttons if master view does not allow

This commit is contained in:
Lance Edgar 2024-11-25 18:45:36 -06:00
parent 38e5d9eb38
commit 6085ea78ec

View file

@ -682,13 +682,13 @@
<%def name="render_crud_header_buttons()">
% if master:
% if master.viewing:
% if instance_editable and master.has_perm('edit'):
% if master.editable and instance_editable and master.has_perm('edit'):
<wutta-button once
tag="a" href="${master.get_action_url('edit', instance)}"
icon-left="edit"
label="Edit This" />
% endif
% if instance_deletable and master.has_perm('delete'):
% if master.deletable and instance_deletable and master.has_perm('delete'):
<wutta-button once type="is-danger"
tag="a" href="${master.get_action_url('delete', instance)}"
icon-left="trash"
@ -701,7 +701,7 @@
icon-left="eye"
label="View This" />
% endif
% if instance_deletable and master.has_perm('delete'):
% if master.deletable and instance_deletable and master.has_perm('delete'):
<wutta-button once type="is-danger"
tag="a" href="${master.get_action_url('delete', instance)}"
icon-left="trash"
@ -714,7 +714,7 @@
icon-left="eye"
label="View This" />
% endif
% if instance_editable and master.has_perm('edit'):
% if master.editable and instance_editable and master.has_perm('edit'):
<wutta-button once
tag="a" href="${master.get_action_url('edit', instance)}"
icon-left="edit"