Implement Care RBAC role→permission→app matrix.
Deploy Ladill Care / deploy (push) Successful in 57s

Replace broad doctor/nurse specialty access with granular roles and primary
apps, permission inheritance for lab/BB managers, and cannot-rules for
discharge, lab approve, and cashier vs billing officer.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 00:24:09 +00:00
co-authored by Cursor
parent 55a1288d30
commit ac870bcf33
21 changed files with 913 additions and 239 deletions
@@ -9,7 +9,12 @@
</div>
<x-settings.card title="Invitation">
<form method="POST" action="{{ route('care.members.store') }}" class="space-y-4" x-data="{ role: '{{ old('role', 'doctor') }}' }">
<form method="POST" action="{{ route('care.members.store') }}" class="space-y-4"
x-data="{
role: '{{ old('role', 'general_physician') }}',
practitionerRoles: @js($practitionerRoles ?? ['doctor', 'general_physician']),
get needsDesk() { return this.practitionerRoles.includes(this.role); }
}">
@csrf
@if (! empty($mailboxOptions))
@@ -41,28 +46,28 @@
<label class="block text-sm font-medium text-slate-700">Role</label>
<select name="role" x-model="role" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
@foreach ($roles as $value => $label)
<option value="{{ $value }}" @selected(old('role', 'doctor') === $value)>{{ $label }}</option>
<option value="{{ $value }}" @selected(old('role', 'general_physician') === $value)>{{ $label }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm font-medium text-slate-700">
<span x-text="role === 'doctor' ? 'Home branch' : 'Branch (optional)'"></span>
<span x-text="needsDesk ? 'Home branch' : 'Branch (optional)'"></span>
</label>
<select name="branch_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm"
:required="role === 'doctor'">
<option value="" x-text="role === 'doctor' ? 'Select a branch…' : 'No branch lock'"></option>
:required="needsDesk">
<option value="" x-text="needsDesk ? 'Select a branch…' : 'No branch lock'"></option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(old('branch_id') == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
<p class="mt-1 text-xs text-slate-500" x-show="role === 'doctor'" x-cloak>
Required for doctors. Add more sites later under Practitioners (telemedicine).
<p class="mt-1 text-xs text-slate-500" x-show="needsDesk" x-cloak>
Required for clinical desks. Add more sites later under Practitioners (telemedicine).
</p>
</div>
<div class="rounded-xl border border-slate-100 bg-slate-50 p-4" x-show="role === 'doctor'" x-cloak>
<div class="rounded-xl border border-slate-100 bg-slate-50 p-4" x-show="needsDesk" x-cloak>
<label class="flex items-start gap-2 text-sm">
<input type="checkbox" name="create_practitioner" value="1" class="mt-0.5" @checked(old('create_practitioner', true))>
<span>