Terminal
This commit is contained in:
@@ -62,7 +62,12 @@ SELECT
|
||||
AS payment_plan_balance_cents,
|
||||
COUNT(DISTINCT d.student_id) FILTER (WHERE d.is_past_due) AS delinquent_accounts,
|
||||
CASE
|
||||
WHEN public.is_billing_admin() OR public.is_auditor() THEN
|
||||
-- Everyone who can genuinely read public.scholarships: billing admins and
|
||||
-- auditors by policy, plus service_role (and superusers) by RLS bypass —
|
||||
-- without that last arm, server-side reporting would see NULL too.
|
||||
WHEN public.is_billing_admin()
|
||||
OR public.is_auditor()
|
||||
OR pg_has_role(current_user, 'service_role', 'MEMBER') THEN
|
||||
COALESCE((
|
||||
SELECT SUM(sc.award_amount_cents)
|
||||
FROM public.scholarships sc
|
||||
|
||||
Reference in New Issue
Block a user