mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 01:05:28 +00:00
@ -83,8 +83,6 @@ final class CompaniesController extends Controller
|
||||
public function edit(Company $company) : View | RedirectResponse
|
||||
{
|
||||
$this->authorize('update', $company);
|
||||
Company::isCurrentUserHasAccess($company);
|
||||
// $company = Company::scopeCompanyables($company, 'id', 'companies');
|
||||
return view('companies/edit')->with('item', $company);
|
||||
}
|
||||
|
||||
|
||||
@ -168,10 +168,7 @@ final class Company extends SnipeModel
|
||||
|
||||
// Set this to check companyable on company
|
||||
if ($companyable instanceof Company) {
|
||||
\Log::error('This is a company!');
|
||||
$companyable_company_id = $companyable->id;
|
||||
\Log::error('Companyable object ID: '.$companyable_company_id);
|
||||
\Log::error('User company ID: '.$current_user_company_id);
|
||||
}
|
||||
return ($current_user_company_id == null) || ($current_user_company_id == $companyable_company_id) || auth()->user()->isSuperUser();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user