Restrict care unit and department setup to admins.
Deploy Ladill Care / deploy (push) Successful in 48s
Deploy Ladill Care / deploy (push) Successful in 48s
Nurses keep Nursing Services for clinical work but can no longer browse or create structural units and departments. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,9 +20,11 @@ class CareUnitController extends Controller
|
||||
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$this->authorizeCareUnitView($request);
|
||||
$this->authorizeAbility($request, 'admin.departments.view');
|
||||
$organization = $this->organization($request);
|
||||
$owner = $this->ownerRef($request);
|
||||
$member = $this->member($request);
|
||||
$permissions = app(CarePermissions::class);
|
||||
|
||||
$units = CareUnit::owned($owner)
|
||||
->where('organization_id', $organization->id)
|
||||
@@ -43,6 +45,7 @@ class CareUnitController extends Controller
|
||||
'organization' => $organization,
|
||||
'kinds' => config('care.care_unit_kinds'),
|
||||
'heroStats' => $heroStats,
|
||||
'canManage' => $permissions->can($member, 'admin.departments.manage'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user