Добавлена роль экономист и настройка доступа к статистике

This commit is contained in:
brusnitsyn
2026-06-25 14:39:42 +09:00
parent 0cdcca9d08
commit 5bcd134a24
2 changed files with 6 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ class HeadquartersController extends Controller
return Inertia::render('Statistic/Headquarters', [
'data' => $finalData['data'],
'grandTotals' => $finalData['grandTotals'],
'isHeadOrAdmin' => $user->isSeniorStaff(),
'isHeadOrAdmin' => $user->isSeniorStaff() || $user->isEconomist(),
'date' => [
$dateRange->startDate->getTimestampMs(),
$dateRange->endDate->getTimestampMs(),

View File

@@ -174,6 +174,11 @@ class User extends Authenticatable
return $this->currentRole()->slug === 'nurse';
}
public function isEconomist(): bool
{
return $this->currentRole()->slug === 'econom';
}
public function isSeniorStaff(): bool
{
return $this->isAdmin() || $this->isChiefDoctor() || $this->isDeputyChief() || $this->isHeadOfDepartment();