A free open source IT asset/license management system
Merge pull request #9876 from Toreg87/fixes/locations-deletable
snipe418ddcfac39a
diff --cc app/Models/Company.phpindex fadc2a1974,529a59a0bc..83b6a0670b--- a/app/Models/Company.php+++ b/app/Models/Company.php@@@ -125,8 -123,13 +125,13 @@@ final class Company extends SnipeMode{if (is_null($companyable)) {return false;- } elseif (!static::isFullMultipleCompanySupportEnabled()) {+ } elseif (! static::isFullMultipleCompanySupportEnabled()) {return true;+ } elseif (!$companyable instanceof Company && !\Schema::hasColumn($companyable->getModel()->getTable(), 'company_id')) {+ // This is primary for the gate:allows-check in location->isDeletable()+ // Locations don't have a company_id so without this it isn't possible to delete locations with FullMultipleCompanySupport enabled+ // because this function is called by SnipePermissionsPolicy->before()+ return true;} else {if (Auth::user()) {$current_user_company_id = Auth::user()->company_id;