Disable the edit button if permission is not allowed
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
71ebade641
commit
1dfa1da0ee
1 changed files with 4 additions and 0 deletions
|
@ -296,6 +296,10 @@
|
||||||
|
|
||||||
if ((row.available_actions) && (row.available_actions.update === true)) {
|
if ((row.available_actions) && (row.available_actions.update === true)) {
|
||||||
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="actions btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a> ';
|
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="actions btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a> ';
|
||||||
|
} else {
|
||||||
|
if ((row.available_actions) && (row.available_actions.update != true)) {
|
||||||
|
actions += '<span data-tooltip="true" title="{{ trans('general.cannot_be_edited') }}"><a class="btn btn-warning btn-sm disabled" onClick="return false;"><i class="fas fa-pencil-alt"></i></a></span> ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((row.available_actions) && (row.available_actions.delete === true)) {
|
if ((row.available_actions) && (row.available_actions.delete === true)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue