|
325 | 325 |
|
326 | 326 | ALTER FUNCTION public.get_orgs_v7(uuid) OWNER TO "postgres"; |
327 | 327 |
|
328 | | -GRANT ALL ON FUNCTION public.get_orgs_v7(uuid) TO "anon"; |
329 | | -GRANT ALL ON FUNCTION public.get_orgs_v7(uuid) TO "authenticated"; |
330 | | -GRANT ALL ON FUNCTION public.get_orgs_v7(uuid) TO "service_role"; |
| 328 | +-- Revoke from public roles (security: prevents users from querying other users' orgs) |
| 329 | +REVOKE ALL ON FUNCTION public.get_orgs_v7(uuid) FROM PUBLIC; |
| 330 | +REVOKE ALL ON FUNCTION public.get_orgs_v7(uuid) FROM "anon"; |
| 331 | +REVOKE ALL ON FUNCTION public.get_orgs_v7(uuid) FROM "authenticated"; |
| 332 | + |
| 333 | +-- Grant only to postgres and service_role (private function) |
| 334 | +GRANT EXECUTE ON FUNCTION public.get_orgs_v7(uuid) TO "postgres"; |
| 335 | +GRANT EXECUTE ON FUNCTION public.get_orgs_v7(uuid) TO "service_role"; |
331 | 336 |
|
332 | 337 | -- Create get_orgs_v7() - wrapper function |
333 | 338 | CREATE OR REPLACE FUNCTION public.get_orgs_v7() |
@@ -538,6 +543,16 @@ BEGIN |
538 | 543 | END; |
539 | 544 | $$; |
540 | 545 |
|
| 546 | +ALTER FUNCTION public.get_orgs_v6(uuid) OWNER TO "postgres"; |
| 547 | + |
| 548 | +-- Revoke from public roles (security: prevents users from querying other users' orgs) |
| 549 | +REVOKE ALL ON FUNCTION public.get_orgs_v6(uuid) FROM PUBLIC; |
| 550 | +REVOKE ALL ON FUNCTION public.get_orgs_v6(uuid) FROM "anon"; |
| 551 | +REVOKE ALL ON FUNCTION public.get_orgs_v6(uuid) FROM "authenticated"; |
| 552 | + |
| 553 | +-- Grant only to postgres and service_role (private function) |
| 554 | +GRANT EXECUTE ON FUNCTION public.get_orgs_v6(uuid) TO "postgres"; |
| 555 | +GRANT EXECUTE ON FUNCTION public.get_orgs_v6(uuid) TO "service_role"; |
541 | 556 |
|
542 | 557 | -- ============================================================================ |
543 | 558 | -- Section 5: reject_access_due_to_2fa function |
|
0 commit comments