Shitty gadgets removed. Some useful gadgets added.

This commit is contained in:
2026-07-11 03:12:56 +03:30
parent 2f8c9f0f4d
commit ed8ff61205
31 changed files with 1489 additions and 170 deletions

View File

@@ -210,3 +210,18 @@ export function canEditTasks(org: Organization | null): boolean {
if (org.isOwner) return true;
return hasPermission(org, 'TAB_TASKS_EDIT');
}
/** Appointments tab only (excludes treatment-only access). */
export function canViewAppointmentsTab(org: Organization | null): boolean {
if (!org) return false;
if (org.type !== 'CLINIC') return false;
if (org.isOwner) return true;
return (
hasPermission(org, 'TAB_APPOINTMENTS_READ') ||
hasPermission(org, 'TAB_APPOINTMENTS_EDIT')
);
}
export function canViewLabCasesOrTasks(org: Organization | null): boolean {
return canViewCases(org) || canViewTasks(org);
}