Добавлена роль экономист и настройка доступа к статистике
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user