Shitty gadgets removed. Some useful gadgets added.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user