mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Improved - disallow deleting manufactureres if there are associated items
This is enforced on the backend - UI imorovement only
This commit is contained in:
parent
9179b6d9c4
commit
856a760d89
|
@ -40,7 +40,7 @@ class ManufacturersTransformer
|
|||
|
||||
$permissions_array['available_actions'] = [
|
||||
'update' => Gate::allows('update', Manufacturer::class) ? true : false,
|
||||
'delete' => Gate::allows('delete', Manufacturer::class) ? true : false,
|
||||
'delete' => (Gate::allows('delete', Manufacturer::class) && ($manufacturer->assets_count == 0) && ($manufacturer->licenses_count==0) && ($manufacturer->consumables_count==0) && ($manufacturer->accessories_count==0) && ($manufacturer->deleted_at=='')) ? true : false,
|
||||
];
|
||||
|
||||
$array += $permissions_array;
|
||||
|
|
Loading…
Reference in a new issue