feature: a minimal v1 backend implemented for treatments feature.
This commit is contained in:
@@ -82,7 +82,8 @@ export function canAccessAppointmentsSection(org: Organization | null): boolean
|
||||
return (
|
||||
hasPermission(org, 'TAB_APPOINTMENTS_READ') ||
|
||||
hasPermission(org, 'TAB_APPOINTMENTS_EDIT') ||
|
||||
hasPermission(org, 'TAB_TREATMENT_EDIT')
|
||||
hasPermission(org, 'TAB_TREATMENT_EDIT') ||
|
||||
hasPermission(org, 'TAB_TREATMENT_READ')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -92,3 +93,13 @@ export function canEditTreatment(org: Organization | null): boolean {
|
||||
if (org.isOwner) return true;
|
||||
return hasPermission(org, 'TAB_TREATMENT_EDIT');
|
||||
}
|
||||
|
||||
/** View treatment workspace (read-only or edit) */
|
||||
export function canViewTreatment(org: Organization | null): boolean {
|
||||
if (!org) return false;
|
||||
if (org.isOwner) return true;
|
||||
return (
|
||||
hasPermission(org, 'TAB_TREATMENT_READ') ||
|
||||
hasPermission(org, 'TAB_TREATMENT_EDIT')
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user