Files
InvoiceShelf/app/Policies/SettingsPolicy.php
Darko Gjorgjijoski eb0a588164 Refactor Administration entrypoint
We moved the administration item to the company switcher in the header
2026-04-04 01:36:28 +02:00

67 lines
1.1 KiB
PHP

<?php
namespace App\Policies;
use App\Models\Company;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class SettingsPolicy
{
use HandlesAuthorization;
public function manageCompany(User $user, Company $company)
{
if ($user->id == $company->owner_id) {
return true;
}
return false;
}
public function manageBackups(User $user)
{
if ($user->isSuperAdmin()) {
return true;
}
return false;
}
public function manageFileDisk(User $user)
{
if ($user->isSuperAdmin()) {
return true;
}
return false;
}
public function manageEmailConfig(User $user)
{
if ($user->isSuperAdmin()) {
return true;
}
return false;
}
public function managePDFConfig(User $user)
{
if ($user->isSuperAdmin()) {
return true;
}
return false;
}
public function manageSettings(User $user)
{
if ($user->isSuperAdmin()) {
return true;
}
return false;
}
}