From a44bd9abe0a137f60f3dac6e9f72af1d844885f5 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 5 Jul 2018 18:02:25 -0700 Subject: [PATCH] Disallow deleting category if there are licenses --- app/Http/Transformers/CategoriesTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/CategoriesTransformer.php b/app/Http/Transformers/CategoriesTransformer.php index 8fc3cb9007..710bf84bc5 100644 --- a/app/Http/Transformers/CategoriesTransformer.php +++ b/app/Http/Transformers/CategoriesTransformer.php @@ -41,7 +41,7 @@ class CategoriesTransformer $permissions_array['available_actions'] = [ 'update' => Gate::allows('update', Category::class) ? true : false, - 'delete' => (Gate::allows('delete', Category::class) && ($category->assets_count == 0) && ($category->accessories_count == 0) && ($category->consumables_count == 0) && ($category->components_count == 0)) ? true : false, + 'delete' => (Gate::allows('delete', Category::class) && ($category->assets_count == 0) && ($category->accessories_count == 0) && ($category->consumables_count == 0) && ($category->components_count == 0) && ($category->licenses_count == 0)) ? true : false, ]; $array += $permissions_array;