Expand specialty RBAC with dedicated specialist roles and support access.
Deploy Ladill Care / deploy (push) Successful in 41s
Deploy Ladill Care / deploy (push) Successful in 41s
Add cardiologist/ENT/derm/ophthalmology/ortho/podiatry/fertility roles and manage/refer/view matrices so GPs, nurses, lab, pharmacy, and reception get realistic module access beyond single-app specialists. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -123,7 +123,7 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
'owner_ref' => $owner->public_id,
|
||||
'organization_id' => $employer->id,
|
||||
'user_ref' => strtolower($nurse->email),
|
||||
'role' => 'nurse',
|
||||
'role' => 'ed_nurse',
|
||||
]);
|
||||
|
||||
$branch = Branch::create([
|
||||
@@ -195,7 +195,7 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
|
||||
$nurse = User::create([
|
||||
'public_id' => 'er-docs-nurse',
|
||||
'name' => 'Nurse',
|
||||
'name' => 'ED Nurse',
|
||||
'email' => 'er-docs-nurse@example.com',
|
||||
]);
|
||||
|
||||
@@ -222,7 +222,7 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
'owner_ref' => $owner->public_id,
|
||||
'organization_id' => $organization->id,
|
||||
'user_ref' => $nurse->public_id,
|
||||
'role' => 'nurse',
|
||||
'role' => 'ed_nurse',
|
||||
]);
|
||||
|
||||
$branch = Branch::create([
|
||||
@@ -299,8 +299,8 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
|
||||
$organization = Organization::create([
|
||||
'owner_ref' => $owner->public_id,
|
||||
'name' => 'Cardio Clinic',
|
||||
'slug' => 'cardio-docs-clinic',
|
||||
'name' => 'Rad Clinic',
|
||||
'slug' => 'rad-docs-clinic',
|
||||
'settings' => [
|
||||
'onboarded' => true,
|
||||
'plan' => 'pro',
|
||||
@@ -330,9 +330,9 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
]);
|
||||
|
||||
$modules = app(SpecialtyModuleService::class);
|
||||
$modules->activate($organization, $owner->public_id, 'cardiology');
|
||||
$modules->activate($organization, $owner->public_id, 'radiology');
|
||||
|
||||
$dept = Department::query()->where('type', 'cardiology')->where('branch_id', $branch->id)->firstOrFail();
|
||||
$dept = Department::query()->where('type', 'radiology')->where('branch_id', $branch->id)->firstOrFail();
|
||||
|
||||
$patient = Patient::create([
|
||||
'owner_ref' => $owner->public_id,
|
||||
@@ -369,11 +369,12 @@ class CareNurseOrgAccessTest extends TestCase
|
||||
]);
|
||||
|
||||
$labMember = Member::query()->where('user_ref', $lab->public_id)->firstOrFail();
|
||||
$this->assertSame('view', $modules->memberAccessLevel($organization, $labMember, 'cardiology'));
|
||||
// Lab manages pathology/blood bank; radiology is view-only.
|
||||
$this->assertSame('view', $modules->memberAccessLevel($organization, $labMember, 'radiology'));
|
||||
|
||||
$this->actingAs($lab)
|
||||
->get(route('care.specialty.workspace', [
|
||||
'module' => 'cardiology',
|
||||
'module' => 'radiology',
|
||||
'visit' => $visit,
|
||||
'tab' => 'documents',
|
||||
]))
|
||||
|
||||
Reference in New Issue
Block a user