Check the asset is not deleted when creating the permissions array

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-02-14 10:14:38 +00:00
parent 8a4c90ade8
commit 638071dadd

View file

@ -72,7 +72,7 @@ class AssetMaintenancesTransformer
];
$permissions_array['available_actions'] = [
'update' => Gate::allows('update', Asset::class),
'update' => (Gate::allows('update', Asset::class) && ($assetmaintenance->asset->deleted_at=='')) ? true : false,
'delete' => Gate::allows('delete', Asset::class),
];