@opengeni/db 0.36.1 → 3.1.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attached-browser-devices.d.ts +7 -0
- package/dist/automations.d.ts +154 -0
- package/dist/canonical-human-identities.js +3 -3
- package/dist/capability-integrations.d.ts +13 -0
- package/dist/child-lifecycle-notices.d.ts +68 -0
- package/dist/{chunk-GYO7ED2Q.js → chunk-EULAN2NP.js} +2 -2
- package/dist/{chunk-VTPRIXKG.js → chunk-NJVZPWXY.js} +3 -3
- package/dist/{chunk-HSOWSYOX.js → chunk-NMUBV7Z5.js} +19 -11
- package/dist/chunk-NMUBV7Z5.js.map +1 -0
- package/dist/chunk-OF5OBB76.js +4457 -0
- package/dist/chunk-OF5OBB76.js.map +1 -0
- package/dist/{chunk-5KTIEDX7.js → chunk-PR2WMLOQ.js} +7714 -4443
- package/dist/chunk-PR2WMLOQ.js.map +1 -0
- package/dist/{chunk-Z7VYMNPZ.js → chunk-SCPUJS53.js} +41 -4
- package/dist/chunk-SCPUJS53.js.map +1 -0
- package/dist/{chunk-SK7YYHBI.js → chunk-SIBYBA2D.js} +46 -1
- package/dist/chunk-SIBYBA2D.js.map +1 -0
- package/dist/chunk-TIKF3KTI.js +383 -0
- package/dist/chunk-TIKF3KTI.js.map +1 -0
- package/dist/chunk-ZZ5LJEFX.js +516 -0
- package/dist/chunk-ZZ5LJEFX.js.map +1 -0
- package/dist/codemode-operations.d.ts +1 -6
- package/dist/company-brain-context-selection-schema.d.ts +705 -0
- package/dist/company-brain-context-selection.d.ts +94 -0
- package/dist/company-brain-governed-writes.d.ts +24 -0
- package/dist/company-brain.d.ts +55 -0
- package/dist/company-profile-agent-admin.d.ts +15 -0
- package/dist/company-profile-schema.d.ts +619 -2
- package/dist/company-profile.d.ts +9 -4
- package/dist/connection-authority.d.ts +95 -0
- package/dist/connection-scopes.d.ts +8 -0
- package/dist/connection-tenancy-backfill.d.ts +41 -0
- package/dist/connection-token-resolver.d.ts +30 -1
- package/dist/database.d.ts +19 -0
- package/dist/editable-artifact-durable-export.d.ts +10 -0
- package/dist/editable-artifact-durable-export.js +18 -3
- package/dist/editable-artifact-durable-export.js.map +1 -1
- package/dist/editable-artifacts.d.ts +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/governed-learning-activation-schema.d.ts +984 -0
- package/dist/governed-learning-activation.d.ts +98 -0
- package/dist/governed-learning-evaluator-schema.d.ts +633 -0
- package/dist/governed-learning-evaluator.d.ts +28 -0
- package/dist/index.d.ts +1633 -87
- package/dist/index.js +22004 -8109
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +18 -0
- package/dist/integration-bindings.d.ts +1 -0
- package/dist/integration-facets.d.ts +30 -0
- package/dist/interaction-placement-loss.d.ts +22 -0
- package/dist/knowledge-source-sync-schema.d.ts +730 -0
- package/dist/knowledge-source-sync.d.ts +60 -0
- package/dist/managed-human-provisioning.d.ts +25 -0
- package/dist/memory-domain.d.ts +3 -3
- package/dist/migrate.d.ts +11 -1
- package/dist/migrate.js +1 -1
- package/dist/new-session-drafts.d.ts +43 -5
- package/dist/organization-membership-backfill.d.ts +174 -0
- package/dist/organization-membership-lifecycle.d.ts +162 -0
- package/dist/pr-review.d.ts +107 -0
- package/dist/preference-registry-schema.d.ts +2 -0
- package/dist/preference-registry.d.ts +2 -0
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +23 -9
- package/dist/schema.d.ts +24925 -13697
- package/dist/schema.js +103 -1
- package/dist/scoped-knowledge-schema.d.ts +52 -1
- package/dist/session-background-commands.d.ts +125 -0
- package/dist/session-background-commands.js +34 -0
- package/dist/session-background-commands.js.map +1 -0
- package/dist/session-control.d.ts +156 -3
- package/dist/session-goal-pacing.d.ts +68 -0
- package/dist/session-queue-commands.d.ts +42 -5
- package/dist/session-realtime-ledger.d.ts +3 -0
- package/dist/session-tenancy.d.ts +71 -1
- package/dist/session-tenancy.js +25 -3
- package/dist/session-tool-call-settlement.d.ts +9 -4
- package/dist/slack-routing-personal-workspace.d.ts +23 -0
- package/dist/slack-routing.d.ts +153 -0
- package/dist/slack-task-policy-schema.d.ts +34 -0
- package/dist/slack-task-policy.d.ts +8 -0
- package/dist/slack-user-link-access.d.ts +1 -0
- package/dist/task-notes-schema.d.ts +594 -0
- package/dist/task-notes.d.ts +39 -0
- package/dist/turn-initiator.d.ts +2 -0
- package/dist/user-resource-authority.d.ts +109 -0
- package/dist/video-generation.js +3 -3
- package/dist/workspace-authority.d.ts +81 -0
- package/dist/workspace-instruction-policies-schema.d.ts +279 -0
- package/dist/workspace-instruction-policies.d.ts +62 -0
- package/dist/workspace-learning-policy.d.ts +1 -0
- package/dist/workspace-membership-permissions.d.ts +2 -0
- package/drizzle/0240_enrollment_connection_authority.sql +39 -0
- package/drizzle/0240_model_context_user_messages.sql +204 -0
- package/drizzle/0241_atomic_personal_resource_delegation.sql +1000 -0
- package/drizzle/0241_enrollment_agent_runtime.sql +70 -0
- package/drizzle/0243_google_drive_object_acl_authority.sql +554 -0
- package/drizzle/0244_slack_app_home_refresh_queue.sql +120 -0
- package/drizzle/0245_model_context_contribution_facts.sql +88 -0
- package/drizzle/0246_integration_personal_instance_authority.sql +70 -0
- package/drizzle/0247_terraform_stacks_provenance_repair.sql +428 -0
- package/drizzle/0248_terraform_stacks_component_resolution_fence.sql +83 -0
- package/drizzle/0249_personal_resource_delegation_authority_correction.sql +662 -0
- package/drizzle/0250_direct_retained_process_owner_liveness.sql +199 -0
- package/drizzle/0251_connected_machine_operation_policy.sql +45 -0
- package/drizzle/0252_scheduled_personal_resource_delegation.sql +1867 -0
- package/drizzle/0253_common_user_resource_authority_lifecycle.sql +1555 -0
- package/drizzle/0254_scoped_variable_set_authority.sql +1255 -0
- package/drizzle/0255_company_brain_governed_write_proposals.sql +524 -0
- package/drizzle/0256_connection_authority_delegation.sql +703 -0
- package/drizzle/0257_goal_revision_decisions_and_root_constraints.sql +436 -0
- package/drizzle/0258_three_scope_document_knowledge_authority.sql +1273 -0
- package/drizzle/0259_company_brain_context_selection_receipts.sql +869 -0
- package/drizzle/0260_task_note_knowledge_promotion.sql +820 -0
- package/drizzle/0261_preference_knowledge_proposal_actor_binding.sql +471 -0
- package/drizzle/0262_scoped_connected_machines_and_rigs.sql +1700 -0
- package/drizzle/0263_organization_membership_lifecycle.sql +3284 -0
- package/drizzle/0264_connection_authority_runtime_activation.sql +1084 -0
- package/drizzle/0266_company_brain_context_receipt_inspection.sql +156 -0
- package/drizzle/0268_governed_learning_decision_receipts.sql +825 -0
- package/drizzle/0269_governed_learning_activation_controller.sql +1874 -0
- package/drizzle/0270_governed_learning_history_inspection.sql +170 -0
- package/drizzle/0271_company_brain_retrieval_only_default.sql +524 -0
- package/drizzle/0272_human_confirmed_learning_activation.sql +591 -0
- package/drizzle/0273_scheduled_variable_set_materialization.sql +268 -0
- package/drizzle/0274_human_confirmed_knowledge_review.sql +310 -0
- package/drizzle/0275_scheduled_connection_authority.sql +5527 -0
- package/drizzle/0276_onboarding_proposal_initiating_human_guc.sql +198 -0
- package/drizzle/0277_workspace_writer_authority_attribution.sql +393 -0
- package/drizzle/0278_workspace_membership_removal_fencing.sql +1174 -0
- package/drizzle/0279_workspace_connection_use_lane.sql +343 -0
- package/drizzle/0280_connection_and_variable_set_audit_attribution.sql +773 -0
- package/drizzle/0281_viewer_holder_authority_claims.sql +52 -0
- package/drizzle/0282_variable_set_session_attach_attribution.sql +178 -0
- package/drizzle/0283_editable_spreadsheet_authored_state.sql +82 -0
- package/drizzle/0284_truthful_human_confirmed_review_reason.sql +930 -0
- package/drizzle/0285_organization_tenancy_inventory.sql +329 -0
- package/drizzle/0286_widen_task_note_expiry_ceiling.sql +391 -0
- package/drizzle/0287_open_suffix_pending_tool_calls.sql +18 -0
- package/drizzle/0288_attached_browser_reenrollment.sql +64 -0
- package/drizzle/0289_session_composer_policy_authority.sql +597 -0
- package/drizzle/0290_organization_membership_backfill.sql +268 -0
- package/drizzle/0291_resource_authority_classification_assertion.sql +371 -0
- package/drizzle/0292_truthful_tenancy_inventory_counters.sql +291 -0
- package/drizzle/0293_confirm_time_rule_rebaseline.sql +615 -0
- package/drizzle/0294_preference_activation_authority.sql +237 -0
- package/drizzle/0295_retire_legacy_standing_memory_mode.sql +476 -0
- package/drizzle/0296_force_rls_backfill_noop_repair.sql +215 -0
- package/drizzle/0297_session_ownership_classification_and_backfill.sql +752 -0
- package/drizzle/0298_organization_tenancy_parity.sql +609 -0
- package/drizzle/0299_organization_membership_lock_order.sql +291 -0
- package/drizzle/0300_tenancy_backfill_ledger.sql +459 -0
- package/drizzle/0301_session_snapshot_and_pin_visibility.sql +181 -0
- package/drizzle/0302_personal_workspace_session_ownership.sql +303 -0
- package/drizzle/0303_session_tenancy_product_activation.sql +919 -0
- package/drizzle/0304_personal_workspace_private_session_reads.sql +97 -0
- package/drizzle/0305_personal_resource_grant_management.sql +584 -0
- package/drizzle/0306_atomic_personal_resource_attachments.sql +1374 -0
- package/drizzle/0307_session_attention_state.sql +51 -0
- package/drizzle/0308_session_archives.sql +35 -0
- package/drizzle/0309_channel_project_pins.sql +6 -0
- package/drizzle/0310_channel_project_order.sql +27 -0
- package/drizzle/0311_company_scope_and_private_session_create.sql +656 -0
- package/drizzle/0312_quiescent_session_tree_deletion.sql +39 -0
- package/drizzle/0313_private_child_session_authority.sql +365 -0
- package/drizzle/0314_unregistered_organization_invitations.sql +606 -0
- package/drizzle/0315_personal_github_repository_selection.sql +624 -0
- package/drizzle/0316_human_confirmed_activation_resumed_generation.sql +869 -0
- package/drizzle/0317_session_goal_continuation_hold.sql +64 -0
- package/drizzle/0318_session_turn_startup_milestones.sql +115 -0
- package/drizzle/0319_event_triggered_automations.sql +254 -0
- package/drizzle/0320_pr_review_pack.sql +113 -0
- package/drizzle/0321_slack_bot_environment_display_name.sql +15 -0
- package/drizzle/0322_session_turns_unclaimed_prompt_trigger_index.sql +5 -0
- package/drizzle/0323_organization_private_session_enablement.sql +489 -0
- package/drizzle/0324_human_confirmed_company_profile_agent_admin.sql +856 -0
- package/drizzle/0325_child_lifecycle_notices.sql +44 -0
- package/drizzle/0326_interaction_operation_error_codes.sql +62 -0
- package/drizzle/0327_slack_first_task_hint.sql +29 -0
- package/drizzle/0328_session_background_commands.sql +590 -0
- package/drizzle/0329_slack_orchestration_delivery_events.sql +91 -0
- package/drizzle/0330_api_key_descriptions.sql +20 -0
- package/drizzle/0331_managed_organization_creation.sql +163 -0
- package/drizzle/0332_organization_shared_workspace_control_plane.sql +539 -0
- package/drizzle/0333_session_turn_prompt_routing.sql +45 -0
- package/drizzle/0334_connected_machine_workspace_root.sql +99 -0
- package/drizzle/0335_slack_workspace_routing.sql +460 -0
- package/drizzle/0336_atomic_session_fork_visibility.sql +667 -0
- package/drizzle/0337_slack_routed_action_handles.sql +189 -0
- package/drizzle/0338_atomic_connected_machine_attachments.sql +410 -0
- package/drizzle/0339_document_authority_reclassification.sql +1153 -0
- package/drizzle/0340_tenancy_backfill_activation_evidence.sql +1347 -0
- package/drizzle/0341_slack_routing_probe_organization_fence.sql +109 -0
- package/package.json +10 -6
- package/src/attached-browser-devices.ts +233 -5
- package/src/automations.ts +911 -0
- package/src/browser-sessions.ts +10 -0
- package/src/capability-integrations.ts +175 -1
- package/src/child-lifecycle-notices.ts +241 -0
- package/src/codemode-operations.ts +1 -35
- package/src/company-brain-context-selection-schema.ts +100 -0
- package/src/company-brain-context-selection.ts +359 -0
- package/src/company-brain-governed-writes.ts +1170 -0
- package/src/company-brain.ts +309 -0
- package/src/company-profile-agent-admin.ts +225 -0
- package/src/company-profile-schema.ts +121 -1
- package/src/company-profile.ts +21 -0
- package/src/computer-sessions.ts +10 -1
- package/src/connection-authority.ts +290 -0
- package/src/connection-scopes.ts +20 -0
- package/src/connection-tenancy-backfill.ts +81 -0
- package/src/connection-token-resolver.ts +263 -31
- package/src/database.ts +75 -2
- package/src/editable-artifact-durable-export.ts +27 -0
- package/src/editable-artifacts-schema.ts +10 -5
- package/src/editable-artifacts.ts +21 -11
- package/src/governed-learning-activation-schema.ts +121 -0
- package/src/governed-learning-activation.ts +588 -0
- package/src/governed-learning-evaluator-schema.ts +72 -0
- package/src/governed-learning-evaluator.ts +217 -0
- package/src/index.ts +12001 -1699
- package/src/insights.ts +107 -0
- package/src/integration-bindings.ts +88 -6
- package/src/integration-facets.ts +287 -84
- package/src/interaction-placement-loss.ts +234 -0
- package/src/knowledge-source-sync-schema.ts +83 -0
- package/src/knowledge-source-sync.ts +530 -0
- package/src/managed-human-provisioning.ts +116 -0
- package/src/memory-domain.ts +27 -32
- package/src/migrate.ts +77 -1
- package/src/new-session-drafts.ts +229 -35
- package/src/organization-membership-backfill.ts +735 -0
- package/src/organization-membership-lifecycle.ts +985 -0
- package/src/pr-review.ts +890 -0
- package/src/preference-registry.ts +31 -1
- package/src/provision-roles.ts +931 -24
- package/src/runtime-posture-cli.ts +2 -0
- package/src/runtime-posture.ts +1315 -52
- package/src/schema.ts +3336 -438
- package/src/scoped-knowledge-schema.ts +16 -8
- package/src/scoped-knowledge.ts +1 -1
- package/src/session-background-commands.ts +759 -0
- package/src/session-control.ts +640 -74
- package/src/session-goal-pacing.ts +126 -0
- package/src/session-queue-commands.ts +450 -98
- package/src/session-realtime-context.ts +19 -3
- package/src/session-realtime-ledger.ts +75 -12
- package/src/session-realtime-mirror.ts +1 -1
- package/src/session-tenancy.ts +403 -49
- package/src/session-tool-call-settlement.ts +38 -29
- package/src/slack-routing-personal-workspace.ts +67 -0
- package/src/slack-routing.ts +469 -0
- package/src/slack-task-policy-schema.ts +5 -0
- package/src/slack-task-policy.ts +18 -0
- package/src/slack-user-link-access.ts +17 -1
- package/src/task-notes-schema.ts +74 -0
- package/src/task-notes.ts +124 -2
- package/src/turn-initiator.ts +8 -0
- package/src/user-resource-authority.ts +377 -0
- package/src/workspace-authority.ts +160 -0
- package/src/workspace-instruction-policies-schema.ts +53 -1
- package/src/workspace-instruction-policies.ts +528 -77
- package/src/workspace-learning-policy.ts +21 -5
- package/src/workspace-membership-permissions.ts +9 -0
- package/dist/chunk-5KTIEDX7.js.map +0 -1
- package/dist/chunk-FPVAD4CO.js +0 -117
- package/dist/chunk-FPVAD4CO.js.map +0 -1
- package/dist/chunk-HSOWSYOX.js.map +0 -1
- package/dist/chunk-SK7YYHBI.js.map +0 -1
- package/dist/chunk-VKLB2ZGI.js +0 -2389
- package/dist/chunk-VKLB2ZGI.js.map +0 -1
- package/dist/chunk-Z7VYMNPZ.js.map +0 -1
- /package/dist/{chunk-GYO7ED2Q.js.map → chunk-EULAN2NP.js.map} +0 -0
- /package/dist/{chunk-VTPRIXKG.js.map → chunk-NJVZPWXY.js.map} +0 -0
package/src/provision-roles.ts
CHANGED
|
@@ -482,11 +482,48 @@ async function grantAppRoleIfSchemaExists(
|
|
|
482
482
|
const runtimeReadUpdateTables = `ARRAY[${RUNTIME_READ_UPDATE_TABLES.map(literal).join(", ")}]`;
|
|
483
483
|
const runtimeReadInsertTables = `ARRAY[${RUNTIME_READ_INSERT_TABLES.map(literal).join(", ")}]`;
|
|
484
484
|
const runtimeReadInsertUpdateTables = `ARRAY[${RUNTIME_READ_INSERT_UPDATE_TABLES.map(literal).join(", ")}]`;
|
|
485
|
+
const organizationMembershipLifecycleRoutines = `ARRAY[${[
|
|
486
|
+
"list_self_organization_memberships(text)",
|
|
487
|
+
"list_self_organization_invitations(text)",
|
|
488
|
+
"list_self_organization_invitations(text,uuid,integer)",
|
|
489
|
+
"get_self_organization_invitation(text,uuid)",
|
|
490
|
+
"list_organization_members(uuid,text)",
|
|
491
|
+
"list_organization_invitations(uuid,text,uuid,integer)",
|
|
492
|
+
"get_organization_administration_overview(uuid,text)",
|
|
493
|
+
"create_managed_organization(text,text,text,uuid)",
|
|
494
|
+
"assert_organization_shared_workspace_administrator(uuid,uuid,text)",
|
|
495
|
+
"open_organization_shared_workspace_administration_capability(uuid,uuid,text)",
|
|
496
|
+
"close_organization_shared_workspace_administration_capability(uuid)",
|
|
497
|
+
"create_organization_shared_workspace(uuid,text,text,text,text,uuid)",
|
|
498
|
+
"upsert_organization_shared_workspace_member(uuid,uuid,text,uuid,text,text,jsonb,boolean)",
|
|
499
|
+
"update_organization_name(uuid,text,text,timestamptz,uuid)",
|
|
500
|
+
"create_organization_invitation_v2(jsonb)",
|
|
501
|
+
"bind_pending_organization_invitations_for_verified_email(text,text)",
|
|
502
|
+
"has_pending_organization_invitation_for_subject(text)",
|
|
503
|
+
"accept_organization_invitation_v2(jsonb)",
|
|
504
|
+
"organization_membership_command(jsonb)",
|
|
505
|
+
"prepare_organization_membership_protocol_settlements(jsonb)",
|
|
506
|
+
"assert_active_managed_human_organization_membership(uuid,text)",
|
|
507
|
+
"resolve_workspace_writer_grant_identity(uuid,text)",
|
|
508
|
+
"prepare_workspace_membership_removal_settlements(jsonb)",
|
|
509
|
+
"workspace_membership_removal_command(jsonb)",
|
|
510
|
+
"get_organization_retention_policy(uuid,text)",
|
|
511
|
+
"preview_organization_retention_deletions(uuid,integer)",
|
|
512
|
+
"claim_organization_retention_deletion(uuid,uuid,uuid[])",
|
|
513
|
+
"list_organization_retention_deletion_objects(uuid,uuid,uuid,text,integer)",
|
|
514
|
+
"record_organization_retention_object_deleted(uuid,uuid,uuid,text,text,text,text)",
|
|
515
|
+
"fail_organization_retention_deletion(uuid,uuid,uuid,text)",
|
|
516
|
+
"finalize_organization_retention_deletion(uuid,uuid,uuid,text)",
|
|
517
|
+
"complete_organization_retention_deletion(uuid,uuid,uuid,text)",
|
|
518
|
+
]
|
|
519
|
+
.map(literal)
|
|
520
|
+
.join(", ")}]`;
|
|
485
521
|
await sql.unsafe(`
|
|
486
522
|
DO $$
|
|
487
523
|
DECLARE
|
|
488
524
|
owner_role text := current_user;
|
|
489
525
|
runtime_table text;
|
|
526
|
+
routine_signature text;
|
|
490
527
|
BEGIN
|
|
491
528
|
EXECUTE format('REVOKE CREATE ON DATABASE %I FROM %I', current_database(), ${literal(role)});
|
|
492
529
|
IF EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = ${literal(schema)}) THEN
|
|
@@ -543,6 +580,115 @@ BEGIN
|
|
|
543
580
|
);
|
|
544
581
|
END IF;
|
|
545
582
|
END LOOP;
|
|
583
|
+
-- Migration 0301 creates this target-schema capability before
|
|
584
|
+
-- opengeni_app exists on a fresh migrate-then-provision installation. Its
|
|
585
|
+
-- policy is evaluated for ordinary session-list snapshot writes, so the
|
|
586
|
+
-- runtime role must be able to execute the predicate even when no
|
|
587
|
+
-- visibility-transition capability is active. Re-converge the exact ACL
|
|
588
|
+
-- here and keep PUBLIC revoked.
|
|
589
|
+
IF to_regprocedure(
|
|
590
|
+
format('%I.session_visibility_lifecycle_capability_held()', ${literal(schema)})
|
|
591
|
+
) IS NOT NULL THEN
|
|
592
|
+
EXECUTE format(
|
|
593
|
+
'REVOKE ALL ON FUNCTION %I.session_visibility_lifecycle_capability_held() FROM PUBLIC',
|
|
594
|
+
${literal(schema)}
|
|
595
|
+
);
|
|
596
|
+
EXECUTE format(
|
|
597
|
+
'GRANT EXECUTE ON FUNCTION %I.session_visibility_lifecycle_capability_held() TO %I',
|
|
598
|
+
${literal(schema)},
|
|
599
|
+
${literal(role)}
|
|
600
|
+
);
|
|
601
|
+
END IF;
|
|
602
|
+
-- Migration 0300's tenancy backfill ledger seam has the same shape: its
|
|
603
|
+
-- own conditional GRANT block is skipped whenever opengeni_app does not
|
|
604
|
+
-- yet exist, and these three live in the data schema rather than
|
|
605
|
+
-- opengeni_private, so the blanket sweep above never reaches them.
|
|
606
|
+
-- Re-converge them here so migrate-then-provision matches the reverse
|
|
607
|
+
-- order; without this the "only write path" seam is unreachable on a
|
|
608
|
+
-- green-field database.
|
|
609
|
+
FOR routine_signature IN
|
|
610
|
+
SELECT unnest(ARRAY[
|
|
611
|
+
'open_tenancy_backfill_receipt(uuid, text, text)',
|
|
612
|
+
'record_tenancy_backfill_unresolved(uuid, uuid, text)',
|
|
613
|
+
'complete_tenancy_backfill_receipt(uuid, bigint, bigint, text)'
|
|
614
|
+
])
|
|
615
|
+
LOOP
|
|
616
|
+
IF to_regprocedure(format('%I.%s', ${literal(schema)}, routine_signature))
|
|
617
|
+
IS NOT NULL
|
|
618
|
+
THEN
|
|
619
|
+
EXECUTE format(
|
|
620
|
+
'GRANT EXECUTE ON FUNCTION %I.%s TO %I',
|
|
621
|
+
${literal(schema)},
|
|
622
|
+
routine_signature,
|
|
623
|
+
${literal(role)}
|
|
624
|
+
);
|
|
625
|
+
END IF;
|
|
626
|
+
END LOOP;
|
|
627
|
+
-- Migration 0291's classification assertion seam has the same shape: its
|
|
628
|
+
-- own conditional GRANT block is skipped whenever opengeni_app does not yet
|
|
629
|
+
-- exist, and it lives in the data schema rather than opengeni_private, so
|
|
630
|
+
-- the blanket sweep above never reaches it. (Its inner capability predicate
|
|
631
|
+
-- IS in opengeni_private and is covered by that sweep.)
|
|
632
|
+
IF to_regprocedure(
|
|
633
|
+
format(
|
|
634
|
+
'%I.verify_organization_resource_classification(uuid,text)',
|
|
635
|
+
${literal(schema)}
|
|
636
|
+
)
|
|
637
|
+
) IS NOT NULL THEN
|
|
638
|
+
EXECUTE format(
|
|
639
|
+
'GRANT EXECUTE ON FUNCTION %I.verify_organization_resource_classification(uuid, text) TO %I',
|
|
640
|
+
${literal(schema)},
|
|
641
|
+
${literal(role)}
|
|
642
|
+
);
|
|
643
|
+
END IF;
|
|
644
|
+
-- Migration 0297's session ownership seams have the same shape: their own
|
|
645
|
+
-- conditional GRANT block is skipped whenever opengeni_app does not yet
|
|
646
|
+
-- exist, and they live in the data schema rather than opengeni_private, so
|
|
647
|
+
-- the blanket sweep above never reaches them. (Their inner capability
|
|
648
|
+
-- predicate IS in opengeni_private and is covered by that sweep.)
|
|
649
|
+
IF to_regprocedure(
|
|
650
|
+
format(
|
|
651
|
+
'%I.classify_organization_session_ownership(uuid,text)',
|
|
652
|
+
${literal(schema)}
|
|
653
|
+
)
|
|
654
|
+
) IS NOT NULL THEN
|
|
655
|
+
EXECUTE format(
|
|
656
|
+
'GRANT EXECUTE ON FUNCTION %I.classify_organization_session_ownership(uuid, text) TO %I',
|
|
657
|
+
${literal(schema)},
|
|
658
|
+
${literal(role)}
|
|
659
|
+
);
|
|
660
|
+
END IF;
|
|
661
|
+
IF to_regprocedure(
|
|
662
|
+
format(
|
|
663
|
+
'%I.backfill_organization_session_ownership(uuid,integer,boolean,text)',
|
|
664
|
+
${literal(schema)}
|
|
665
|
+
)
|
|
666
|
+
) IS NOT NULL THEN
|
|
667
|
+
EXECUTE format(
|
|
668
|
+
'GRANT EXECUTE ON FUNCTION %I.backfill_organization_session_ownership(uuid, integer, boolean, text) TO %I',
|
|
669
|
+
${literal(schema)},
|
|
670
|
+
${literal(role)}
|
|
671
|
+
);
|
|
672
|
+
END IF;
|
|
673
|
+
-- Migration 0340's bounded connection convergence and repaired parity
|
|
674
|
+
-- seams also live in the data schema. Converge their exact grants for the
|
|
675
|
+
-- supported migrate-then-provision order.
|
|
676
|
+
FOREACH routine_signature IN ARRAY ARRAY[
|
|
677
|
+
'classify_organization_connection_authority(uuid,text)',
|
|
678
|
+
'backfill_organization_connection_authority(uuid,integer,boolean)',
|
|
679
|
+
'check_organization_tenancy_parity(uuid,integer,integer)'
|
|
680
|
+
] LOOP
|
|
681
|
+
IF to_regprocedure(format('%I.%s', ${literal(schema)}, routine_signature))
|
|
682
|
+
IS NOT NULL
|
|
683
|
+
THEN
|
|
684
|
+
EXECUTE format(
|
|
685
|
+
'GRANT EXECUTE ON FUNCTION %I.%s TO %I',
|
|
686
|
+
${literal(schema)},
|
|
687
|
+
routine_signature,
|
|
688
|
+
${literal(role)}
|
|
689
|
+
);
|
|
690
|
+
END IF;
|
|
691
|
+
END LOOP;
|
|
546
692
|
-- Migration 0110 creates this target-schema-local SECURITY DEFINER
|
|
547
693
|
-- capability before opengeni_app may exist. Re-converge its exact EXECUTE
|
|
548
694
|
-- grant here so the supported migrate-then-provision order is equivalent to
|
|
@@ -613,6 +759,33 @@ BEGIN
|
|
|
613
759
|
${literal(role)}
|
|
614
760
|
);
|
|
615
761
|
END IF;
|
|
762
|
+
-- Migration 0289 creates this definer accessor before opengeni_app may
|
|
763
|
+
-- exist, so its migration-time GRANT is skipped on the supported
|
|
764
|
+
-- migrate-then-provision order. Re-converge it here.
|
|
765
|
+
IF to_regprocedure(
|
|
766
|
+
format(
|
|
767
|
+
'%I.preference_registry_activation_authority(uuid,uuid[])',
|
|
768
|
+
${literal(schema)}
|
|
769
|
+
)
|
|
770
|
+
) IS NOT NULL THEN
|
|
771
|
+
EXECUTE format(
|
|
772
|
+
'GRANT EXECUTE ON FUNCTION %I.preference_registry_activation_authority(uuid, uuid[]) TO %I',
|
|
773
|
+
${literal(schema)},
|
|
774
|
+
${literal(role)}
|
|
775
|
+
);
|
|
776
|
+
END IF;
|
|
777
|
+
IF to_regprocedure(
|
|
778
|
+
format(
|
|
779
|
+
'%I.preference_registry_create_knowledge_proposal_for_attempt(uuid,uuid,uuid,uuid,uuid,integer,uuid,text,uuid,text,text,text,text,integer,text,jsonb,timestamptz,text)',
|
|
780
|
+
${literal(schema)}
|
|
781
|
+
)
|
|
782
|
+
) IS NOT NULL THEN
|
|
783
|
+
EXECUTE format(
|
|
784
|
+
'GRANT EXECUTE ON FUNCTION %I.preference_registry_create_knowledge_proposal_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, uuid, text, text, text, text, integer, text, jsonb, timestamptz, text) TO %I',
|
|
785
|
+
${literal(schema)},
|
|
786
|
+
${literal(role)}
|
|
787
|
+
);
|
|
788
|
+
END IF;
|
|
616
789
|
IF to_regprocedure(
|
|
617
790
|
format(
|
|
618
791
|
'%I.create_task_note_for_attempt(uuid,uuid,uuid,uuid,uuid,integer,uuid,text,text,integer)',
|
|
@@ -635,6 +808,129 @@ BEGIN
|
|
|
635
808
|
${literal(role)}
|
|
636
809
|
);
|
|
637
810
|
END IF;
|
|
811
|
+
IF to_regprocedure(
|
|
812
|
+
format(
|
|
813
|
+
'%I.company_brain_context_get_or_create_selection(uuid,uuid,uuid,uuid,uuid,integer)',
|
|
814
|
+
${literal(schema)}
|
|
815
|
+
)
|
|
816
|
+
) IS NOT NULL THEN
|
|
817
|
+
EXECUTE format(
|
|
818
|
+
'GRANT EXECUTE ON FUNCTION %I.company_brain_context_get_or_create_selection(uuid, uuid, uuid, uuid, uuid, integer) TO %I',
|
|
819
|
+
${literal(schema)},
|
|
820
|
+
${literal(role)}
|
|
821
|
+
);
|
|
822
|
+
END IF;
|
|
823
|
+
IF to_regprocedure(
|
|
824
|
+
format(
|
|
825
|
+
'%I.company_brain_inspect_context_receipts(uuid,uuid,text,uuid,timestamptz,uuid,integer)',
|
|
826
|
+
${literal(schema)}
|
|
827
|
+
)
|
|
828
|
+
) IS NOT NULL THEN
|
|
829
|
+
EXECUTE format(
|
|
830
|
+
'GRANT EXECUTE ON FUNCTION %I.company_brain_inspect_context_receipts(uuid, uuid, text, uuid, timestamptz, uuid, integer) TO %I',
|
|
831
|
+
${literal(schema)},
|
|
832
|
+
${literal(role)}
|
|
833
|
+
);
|
|
834
|
+
END IF;
|
|
835
|
+
IF to_regprocedure(
|
|
836
|
+
format(
|
|
837
|
+
'%I.evaluate_governed_learning_proposal(uuid,uuid,uuid,uuid,uuid,integer,uuid,uuid,uuid,uuid,uuid)',
|
|
838
|
+
${literal(schema)}
|
|
839
|
+
)
|
|
840
|
+
) IS NOT NULL THEN
|
|
841
|
+
EXECUTE format(
|
|
842
|
+
'GRANT EXECUTE ON FUNCTION %I.evaluate_governed_learning_proposal(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid, uuid, uuid) TO %I',
|
|
843
|
+
${literal(schema)},
|
|
844
|
+
${literal(role)}
|
|
845
|
+
);
|
|
846
|
+
END IF;
|
|
847
|
+
IF to_regprocedure(
|
|
848
|
+
format('%I.activate_governed_learning_decision(uuid,uuid,uuid,uuid)', ${literal(schema)})
|
|
849
|
+
) IS NOT NULL THEN
|
|
850
|
+
EXECUTE format(
|
|
851
|
+
'GRANT EXECUTE ON FUNCTION %I.activate_governed_learning_decision(uuid, uuid, uuid, uuid) TO %I',
|
|
852
|
+
${literal(schema)},
|
|
853
|
+
${literal(role)}
|
|
854
|
+
);
|
|
855
|
+
END IF;
|
|
856
|
+
IF to_regprocedure(
|
|
857
|
+
format('%I.activate_human_confirmed_learning_decision(uuid,uuid,uuid,uuid,uuid)', ${literal(schema)})
|
|
858
|
+
) IS NOT NULL THEN
|
|
859
|
+
EXECUTE format(
|
|
860
|
+
'GRANT EXECUTE ON FUNCTION %I.activate_human_confirmed_learning_decision(uuid, uuid, uuid, uuid, uuid) TO %I',
|
|
861
|
+
${literal(schema)},
|
|
862
|
+
${literal(role)}
|
|
863
|
+
);
|
|
864
|
+
END IF;
|
|
865
|
+
IF to_regprocedure(
|
|
866
|
+
format('%I.confirm_remember_knowledge_claim(uuid,uuid,uuid,uuid,integer,uuid,uuid,uuid)', ${literal(schema)})
|
|
867
|
+
) IS NOT NULL THEN
|
|
868
|
+
EXECUTE format(
|
|
869
|
+
'GRANT EXECUTE ON FUNCTION %I.confirm_remember_knowledge_claim(uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid) TO %I',
|
|
870
|
+
${literal(schema)},
|
|
871
|
+
${literal(role)}
|
|
872
|
+
);
|
|
873
|
+
END IF;
|
|
874
|
+
IF to_regprocedure(
|
|
875
|
+
format('%I.undo_governed_learning_activation(uuid,uuid,uuid,uuid)', ${literal(schema)})
|
|
876
|
+
) IS NOT NULL THEN
|
|
877
|
+
EXECUTE format(
|
|
878
|
+
'GRANT EXECUTE ON FUNCTION %I.undo_governed_learning_activation(uuid, uuid, uuid, uuid) TO %I',
|
|
879
|
+
${literal(schema)},
|
|
880
|
+
${literal(role)}
|
|
881
|
+
);
|
|
882
|
+
END IF;
|
|
883
|
+
IF to_regprocedure(
|
|
884
|
+
format('%I.inspect_governed_learning_decisions(uuid,uuid,text,integer)', ${literal(schema)})
|
|
885
|
+
) IS NOT NULL THEN
|
|
886
|
+
EXECUTE format(
|
|
887
|
+
'GRANT EXECUTE ON FUNCTION %I.inspect_governed_learning_decisions(uuid, uuid, text, integer) TO %I',
|
|
888
|
+
${literal(schema)},
|
|
889
|
+
${literal(role)}
|
|
890
|
+
);
|
|
891
|
+
END IF;
|
|
892
|
+
IF to_regprocedure(
|
|
893
|
+
format('%I.inspect_governed_learning_activations(uuid,uuid,text,integer)', ${literal(schema)})
|
|
894
|
+
) IS NOT NULL THEN
|
|
895
|
+
EXECUTE format(
|
|
896
|
+
'GRANT EXECUTE ON FUNCTION %I.inspect_governed_learning_activations(uuid, uuid, text, integer) TO %I',
|
|
897
|
+
${literal(schema)},
|
|
898
|
+
${literal(role)}
|
|
899
|
+
);
|
|
900
|
+
END IF;
|
|
901
|
+
IF to_regprocedure(
|
|
902
|
+
format('%I.inspect_governed_learning_activation_undos(uuid,uuid,text,integer)', ${literal(schema)})
|
|
903
|
+
) IS NOT NULL THEN
|
|
904
|
+
EXECUTE format(
|
|
905
|
+
'GRANT EXECUTE ON FUNCTION %I.inspect_governed_learning_activation_undos(uuid, uuid, text, integer) TO %I',
|
|
906
|
+
${literal(schema)},
|
|
907
|
+
${literal(role)}
|
|
908
|
+
);
|
|
909
|
+
END IF;
|
|
910
|
+
IF to_regprocedure(
|
|
911
|
+
format(
|
|
912
|
+
'%I.replace_task_note_for_attempt(uuid,uuid,uuid,uuid,uuid,integer,uuid,uuid,uuid,uuid,integer,text,text,integer,text)',
|
|
913
|
+
${literal(schema)}
|
|
914
|
+
)
|
|
915
|
+
) IS NOT NULL THEN
|
|
916
|
+
EXECUTE format(
|
|
917
|
+
'GRANT EXECUTE ON FUNCTION %I.replace_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid, uuid, integer, text, text, integer, text) TO %I',
|
|
918
|
+
${literal(schema)},
|
|
919
|
+
${literal(role)}
|
|
920
|
+
);
|
|
921
|
+
END IF;
|
|
922
|
+
IF to_regprocedure(
|
|
923
|
+
format(
|
|
924
|
+
'%I.resolve_task_note_knowledge_promotion_source(uuid,uuid,uuid,uuid,uuid,integer,uuid,integer,text,text,text)',
|
|
925
|
+
${literal(schema)}
|
|
926
|
+
)
|
|
927
|
+
) IS NOT NULL THEN
|
|
928
|
+
EXECUTE format(
|
|
929
|
+
'GRANT EXECUTE ON FUNCTION %I.resolve_task_note_knowledge_promotion_source(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text) TO %I',
|
|
930
|
+
${literal(schema)},
|
|
931
|
+
${literal(role)}
|
|
932
|
+
);
|
|
933
|
+
END IF;
|
|
638
934
|
IF to_regprocedure(
|
|
639
935
|
format(
|
|
640
936
|
'%I.workspace_instruction_policy_get_or_create_snapshot(uuid,uuid,uuid,uuid,uuid,integer)',
|
|
@@ -671,6 +967,30 @@ BEGIN
|
|
|
671
967
|
${literal(role)}
|
|
672
968
|
);
|
|
673
969
|
END IF;
|
|
970
|
+
IF to_regprocedure(
|
|
971
|
+
format(
|
|
972
|
+
'%I.propose_company_profile_for_attempt(uuid,uuid,uuid,uuid,uuid,integer,uuid,text,text,text)',
|
|
973
|
+
${literal(schema)}
|
|
974
|
+
)
|
|
975
|
+
) IS NOT NULL THEN
|
|
976
|
+
EXECUTE format(
|
|
977
|
+
'GRANT EXECUTE ON FUNCTION %I.propose_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, text) TO %I',
|
|
978
|
+
${literal(schema)},
|
|
979
|
+
${literal(role)}
|
|
980
|
+
);
|
|
981
|
+
END IF;
|
|
982
|
+
IF to_regprocedure(
|
|
983
|
+
format(
|
|
984
|
+
'%I.confirm_company_profile_for_attempt(uuid,uuid,uuid,uuid,uuid,integer,uuid,uuid,uuid)',
|
|
985
|
+
${literal(schema)}
|
|
986
|
+
)
|
|
987
|
+
) IS NOT NULL THEN
|
|
988
|
+
EXECUTE format(
|
|
989
|
+
'GRANT EXECUTE ON FUNCTION %I.confirm_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid) TO %I',
|
|
990
|
+
${literal(schema)},
|
|
991
|
+
${literal(role)}
|
|
992
|
+
);
|
|
993
|
+
END IF;
|
|
674
994
|
IF to_regprocedure(
|
|
675
995
|
format(
|
|
676
996
|
'%I.workspace_learning_policy_apply_activation(uuid,text,uuid,uuid,uuid,uuid,bigint,text,text,text)',
|
|
@@ -757,6 +1077,42 @@ BEGIN
|
|
|
757
1077
|
${literal(role)}
|
|
758
1078
|
);
|
|
759
1079
|
END IF;
|
|
1080
|
+
-- Migration 0243 adds the exact Google Drive object authorization and
|
|
1081
|
+
-- safe-citation projections. Re-converge both capabilities for the same
|
|
1082
|
+
-- supported migrate-then-provision order without granting direct mutation
|
|
1083
|
+
-- of their append-only ACL evidence tables.
|
|
1084
|
+
IF to_regprocedure(
|
|
1085
|
+
format(
|
|
1086
|
+
'%I.google_drive_file_authorized(uuid,uuid,text,uuid)',
|
|
1087
|
+
${literal(schema)}
|
|
1088
|
+
)
|
|
1089
|
+
) IS NOT NULL THEN
|
|
1090
|
+
EXECUTE format(
|
|
1091
|
+
'REVOKE ALL ON FUNCTION %I.google_drive_file_authorized(uuid, uuid, text, uuid) FROM PUBLIC',
|
|
1092
|
+
${literal(schema)}
|
|
1093
|
+
);
|
|
1094
|
+
EXECUTE format(
|
|
1095
|
+
'GRANT EXECUTE ON FUNCTION %I.google_drive_file_authorized(uuid, uuid, text, uuid) TO %I',
|
|
1096
|
+
${literal(schema)},
|
|
1097
|
+
${literal(role)}
|
|
1098
|
+
);
|
|
1099
|
+
END IF;
|
|
1100
|
+
IF to_regprocedure(
|
|
1101
|
+
format(
|
|
1102
|
+
'%I.google_drive_document_citation(uuid,uuid,text,uuid,uuid)',
|
|
1103
|
+
${literal(schema)}
|
|
1104
|
+
)
|
|
1105
|
+
) IS NOT NULL THEN
|
|
1106
|
+
EXECUTE format(
|
|
1107
|
+
'REVOKE ALL ON FUNCTION %I.google_drive_document_citation(uuid, uuid, text, uuid, uuid) FROM PUBLIC',
|
|
1108
|
+
${literal(schema)}
|
|
1109
|
+
);
|
|
1110
|
+
EXECUTE format(
|
|
1111
|
+
'GRANT EXECUTE ON FUNCTION %I.google_drive_document_citation(uuid, uuid, text, uuid, uuid) TO %I',
|
|
1112
|
+
${literal(schema)},
|
|
1113
|
+
${literal(role)}
|
|
1114
|
+
);
|
|
1115
|
+
END IF;
|
|
760
1116
|
IF to_regprocedure(
|
|
761
1117
|
format(
|
|
762
1118
|
'%I.ensure_managed_human_personal_workspace(uuid,text,uuid)',
|
|
@@ -773,6 +1129,18 @@ BEGIN
|
|
|
773
1129
|
${literal(role)}
|
|
774
1130
|
);
|
|
775
1131
|
END IF;
|
|
1132
|
+
FOREACH routine_signature IN ARRAY ${organizationMembershipLifecycleRoutines} LOOP
|
|
1133
|
+
IF to_regprocedure(format('%I.%s', ${literal(schema)}, routine_signature)) IS NOT NULL THEN
|
|
1134
|
+
EXECUTE format(
|
|
1135
|
+
'REVOKE ALL ON FUNCTION %I.%s FROM PUBLIC',
|
|
1136
|
+
${literal(schema)}, routine_signature
|
|
1137
|
+
);
|
|
1138
|
+
EXECUTE format(
|
|
1139
|
+
'GRANT EXECUTE ON FUNCTION %I.%s TO %I',
|
|
1140
|
+
${literal(schema)}, routine_signature, ${literal(role)}
|
|
1141
|
+
);
|
|
1142
|
+
END IF;
|
|
1143
|
+
END LOOP;
|
|
776
1144
|
IF to_regprocedure(format('%I.ensure_canonical_human_identity(text,text)', ${literal(schema)})) IS NOT NULL THEN
|
|
777
1145
|
EXECUTE format(
|
|
778
1146
|
'REVOKE ALL ON FUNCTION %I.ensure_canonical_human_identity(text, text) FROM PUBLIC',
|
|
@@ -855,103 +1223,583 @@ BEGIN
|
|
|
855
1223
|
END IF;
|
|
856
1224
|
IF to_regprocedure(
|
|
857
1225
|
format(
|
|
858
|
-
'%I.transition_session_visibility(uuid,uuid,uuid,text,text,integer,text,text)',
|
|
1226
|
+
'%I.transition_session_visibility(uuid,uuid,uuid,text,text,integer,text,text,integer)',
|
|
859
1227
|
${literal(schema)}
|
|
860
1228
|
)
|
|
861
1229
|
) IS NOT NULL THEN
|
|
862
1230
|
EXECUTE format(
|
|
863
|
-
'REVOKE ALL ON FUNCTION %I.transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text) FROM PUBLIC',
|
|
1231
|
+
'REVOKE ALL ON FUNCTION %I.transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text, integer) FROM PUBLIC',
|
|
864
1232
|
${literal(schema)}
|
|
865
1233
|
);
|
|
866
1234
|
EXECUTE format(
|
|
867
|
-
'GRANT EXECUTE ON FUNCTION %I.transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text) TO %I',
|
|
1235
|
+
'GRANT EXECUTE ON FUNCTION %I.transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text, integer) TO %I',
|
|
868
1236
|
${literal(schema)},
|
|
869
1237
|
${literal(role)}
|
|
870
1238
|
);
|
|
871
1239
|
END IF;
|
|
872
1240
|
IF to_regprocedure(
|
|
873
1241
|
format(
|
|
874
|
-
'%I.fork_session_content(uuid,uuid,uuid,text,uuid,text,text,text)',
|
|
1242
|
+
'%I.fork_session_content(uuid,uuid,uuid,text,uuid,text,text,text,integer)',
|
|
875
1243
|
${literal(schema)}
|
|
876
1244
|
)
|
|
877
1245
|
) IS NOT NULL THEN
|
|
878
1246
|
EXECUTE format(
|
|
879
|
-
'REVOKE ALL ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text) FROM PUBLIC',
|
|
1247
|
+
'REVOKE ALL ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text, integer) FROM PUBLIC',
|
|
880
1248
|
${literal(schema)}
|
|
881
1249
|
);
|
|
882
1250
|
EXECUTE format(
|
|
883
|
-
'GRANT EXECUTE ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text) TO %I',
|
|
1251
|
+
'GRANT EXECUTE ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text, integer) TO %I',
|
|
884
1252
|
${literal(schema)},
|
|
885
1253
|
${literal(role)}
|
|
886
1254
|
);
|
|
887
1255
|
END IF;
|
|
888
1256
|
IF to_regprocedure(
|
|
889
1257
|
format(
|
|
890
|
-
'%I.
|
|
1258
|
+
'%I.fork_session_content(uuid,uuid,uuid,text,uuid,text,boolean,text,text,integer)',
|
|
891
1259
|
${literal(schema)}
|
|
892
1260
|
)
|
|
893
1261
|
) IS NOT NULL THEN
|
|
894
1262
|
EXECUTE format(
|
|
895
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1263
|
+
'REVOKE ALL ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer) FROM PUBLIC',
|
|
896
1264
|
${literal(schema)}
|
|
897
1265
|
);
|
|
898
1266
|
EXECUTE format(
|
|
899
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
1267
|
+
'GRANT EXECUTE ON FUNCTION %I.fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer) TO %I',
|
|
900
1268
|
${literal(schema)},
|
|
901
1269
|
${literal(role)}
|
|
902
1270
|
);
|
|
1271
|
+
END IF;
|
|
1272
|
+
IF to_regprocedure(
|
|
1273
|
+
format(
|
|
1274
|
+
'%I.replay_applied_session_fork(uuid,uuid,uuid,text,uuid,text,boolean,text,text,integer)',
|
|
1275
|
+
${literal(schema)}
|
|
1276
|
+
)
|
|
1277
|
+
) IS NOT NULL THEN
|
|
903
1278
|
EXECUTE format(
|
|
904
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1279
|
+
'REVOKE ALL ON FUNCTION %I.replay_applied_session_fork(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer) FROM PUBLIC',
|
|
905
1280
|
${literal(schema)}
|
|
906
1281
|
);
|
|
907
1282
|
EXECUTE format(
|
|
908
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
1283
|
+
'GRANT EXECUTE ON FUNCTION %I.replay_applied_session_fork(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer) TO %I',
|
|
909
1284
|
${literal(schema)},
|
|
910
1285
|
${literal(role)}
|
|
911
1286
|
);
|
|
1287
|
+
END IF;
|
|
1288
|
+
IF to_regprocedure(
|
|
1289
|
+
format('%I.session_tenancy_product_activated(uuid,integer)', ${literal(schema)})
|
|
1290
|
+
) IS NOT NULL THEN
|
|
912
1291
|
EXECUTE format(
|
|
913
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1292
|
+
'REVOKE ALL ON FUNCTION %I.session_tenancy_product_activated(uuid, integer) FROM PUBLIC',
|
|
914
1293
|
${literal(schema)}
|
|
915
1294
|
);
|
|
916
1295
|
EXECUTE format(
|
|
917
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
1296
|
+
'GRANT EXECUTE ON FUNCTION %I.session_tenancy_product_activated(uuid, integer) TO %I',
|
|
918
1297
|
${literal(schema)},
|
|
919
1298
|
${literal(role)}
|
|
920
1299
|
);
|
|
921
1300
|
EXECUTE format(
|
|
922
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1301
|
+
'REVOKE ALL ON FUNCTION %I.session_tenancy_any_product_activation() FROM PUBLIC',
|
|
923
1302
|
${literal(schema)}
|
|
924
1303
|
);
|
|
925
1304
|
EXECUTE format(
|
|
926
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
1305
|
+
'GRANT EXECUTE ON FUNCTION %I.session_tenancy_any_product_activation() TO %I',
|
|
927
1306
|
${literal(schema)},
|
|
928
1307
|
${literal(role)}
|
|
929
1308
|
);
|
|
930
1309
|
EXECUTE format(
|
|
931
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1310
|
+
'REVOKE ALL ON FUNCTION %I.assert_session_tenancy_quiescent(uuid, uuid, uuid, boolean) FROM PUBLIC',
|
|
932
1311
|
${literal(schema)}
|
|
933
1312
|
);
|
|
934
1313
|
EXECUTE format(
|
|
935
|
-
'
|
|
1314
|
+
'REVOKE ALL ON FUNCTION %I.assert_session_tenancy_quiescent(uuid, uuid, uuid, boolean) FROM %I',
|
|
936
1315
|
${literal(schema)},
|
|
937
1316
|
${literal(role)}
|
|
938
1317
|
);
|
|
1318
|
+
END IF;
|
|
1319
|
+
IF to_regprocedure(
|
|
1320
|
+
format('%I.get_private_session_create_policy(uuid,uuid,text)', ${literal(schema)})
|
|
1321
|
+
) IS NOT NULL THEN
|
|
939
1322
|
EXECUTE format(
|
|
940
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1323
|
+
'REVOKE ALL ON FUNCTION %I.get_private_session_create_policy(uuid, uuid, text) FROM PUBLIC',
|
|
941
1324
|
${literal(schema)}
|
|
942
1325
|
);
|
|
943
1326
|
EXECUTE format(
|
|
944
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
945
|
-
${literal(schema)},
|
|
946
|
-
${literal(role)}
|
|
1327
|
+
'GRANT EXECUTE ON FUNCTION %I.get_private_session_create_policy(uuid, uuid, text) TO %I',
|
|
1328
|
+
${literal(schema)}, ${literal(role)}
|
|
947
1329
|
);
|
|
1330
|
+
END IF;
|
|
1331
|
+
IF to_regprocedure(
|
|
1332
|
+
format('%I.get_organization_private_session_settings(uuid,text)', ${literal(schema)})
|
|
1333
|
+
) IS NOT NULL THEN
|
|
948
1334
|
EXECUTE format(
|
|
949
|
-
'REVOKE ALL ON FUNCTION %I.
|
|
1335
|
+
'REVOKE ALL ON FUNCTION %I.get_organization_private_session_settings(uuid, text) FROM PUBLIC',
|
|
950
1336
|
${literal(schema)}
|
|
951
1337
|
);
|
|
952
1338
|
EXECUTE format(
|
|
953
|
-
'GRANT EXECUTE ON FUNCTION %I.
|
|
954
|
-
${literal(schema)},
|
|
1339
|
+
'GRANT EXECUTE ON FUNCTION %I.get_organization_private_session_settings(uuid, text) TO %I',
|
|
1340
|
+
${literal(schema)}, ${literal(role)}
|
|
1341
|
+
);
|
|
1342
|
+
END IF;
|
|
1343
|
+
IF to_regprocedure(
|
|
1344
|
+
format(
|
|
1345
|
+
'%I.update_organization_private_session_settings(uuid,text,boolean,bigint,uuid)',
|
|
1346
|
+
${literal(schema)}
|
|
1347
|
+
)
|
|
1348
|
+
) IS NOT NULL THEN
|
|
1349
|
+
EXECUTE format(
|
|
1350
|
+
'REVOKE ALL ON FUNCTION %I.update_organization_private_session_settings(uuid, text, boolean, bigint, uuid) FROM PUBLIC',
|
|
1351
|
+
${literal(schema)}
|
|
1352
|
+
);
|
|
1353
|
+
EXECUTE format(
|
|
1354
|
+
'GRANT EXECUTE ON FUNCTION %I.update_organization_private_session_settings(uuid, text, boolean, bigint, uuid) TO %I',
|
|
1355
|
+
${literal(schema)}, ${literal(role)}
|
|
1356
|
+
);
|
|
1357
|
+
END IF;
|
|
1358
|
+
IF to_regprocedure(
|
|
1359
|
+
format('%I.organization_private_sessions_enabled(uuid)', ${literal(schema)})
|
|
1360
|
+
) IS NOT NULL THEN
|
|
1361
|
+
EXECUTE format(
|
|
1362
|
+
'REVOKE ALL ON FUNCTION %I.organization_private_sessions_enabled(uuid) FROM PUBLIC',
|
|
1363
|
+
${literal(schema)}
|
|
1364
|
+
);
|
|
1365
|
+
EXECUTE format(
|
|
1366
|
+
'REVOKE ALL ON FUNCTION %I.organization_private_sessions_enabled(uuid) FROM %I',
|
|
1367
|
+
${literal(schema)}, ${literal(role)}
|
|
1368
|
+
);
|
|
1369
|
+
END IF;
|
|
1370
|
+
IF to_regprocedure(
|
|
1371
|
+
format('%I.open_private_session_create_capability(uuid,uuid,uuid,text)', ${literal(schema)})
|
|
1372
|
+
) IS NOT NULL THEN
|
|
1373
|
+
EXECUTE format(
|
|
1374
|
+
'REVOKE ALL ON FUNCTION %I.open_private_session_create_capability(uuid, uuid, uuid, text) FROM PUBLIC',
|
|
1375
|
+
${literal(schema)}
|
|
1376
|
+
);
|
|
1377
|
+
EXECUTE format(
|
|
1378
|
+
'GRANT EXECUTE ON FUNCTION %I.open_private_session_create_capability(uuid, uuid, uuid, text) TO %I',
|
|
1379
|
+
${literal(schema)}, ${literal(role)}
|
|
1380
|
+
);
|
|
1381
|
+
EXECUTE format(
|
|
1382
|
+
'REVOKE ALL ON FUNCTION %I.close_private_session_create_capability(uuid) FROM PUBLIC',
|
|
1383
|
+
${literal(schema)}
|
|
1384
|
+
);
|
|
1385
|
+
EXECUTE format(
|
|
1386
|
+
'GRANT EXECUTE ON FUNCTION %I.close_private_session_create_capability(uuid) TO %I',
|
|
1387
|
+
${literal(schema)}, ${literal(role)}
|
|
1388
|
+
);
|
|
1389
|
+
END IF;
|
|
1390
|
+
IF to_regprocedure(
|
|
1391
|
+
format(
|
|
1392
|
+
'%I.open_private_child_session_create_capability(uuid,uuid,uuid,uuid,uuid,uuid,integer)',
|
|
1393
|
+
${literal(schema)}
|
|
1394
|
+
)
|
|
1395
|
+
) IS NOT NULL THEN
|
|
1396
|
+
EXECUTE format(
|
|
1397
|
+
'REVOKE ALL ON FUNCTION %I.open_private_child_session_create_capability(uuid,uuid,uuid,uuid,uuid,uuid,integer) FROM PUBLIC',
|
|
1398
|
+
${literal(schema)}
|
|
1399
|
+
);
|
|
1400
|
+
EXECUTE format(
|
|
1401
|
+
'GRANT EXECUTE ON FUNCTION %I.open_private_child_session_create_capability(uuid,uuid,uuid,uuid,uuid,uuid,integer) TO %I',
|
|
1402
|
+
${literal(schema)}, ${literal(role)}
|
|
1403
|
+
);
|
|
1404
|
+
END IF;
|
|
1405
|
+
IF to_regprocedure(
|
|
1406
|
+
format(
|
|
1407
|
+
'%I.create_xai_subscription_credential(uuid,uuid,text,text,text,text,text,text,text,timestamptz)',
|
|
1408
|
+
${literal(schema)}
|
|
1409
|
+
)
|
|
1410
|
+
) IS NOT NULL THEN
|
|
1411
|
+
EXECUTE format(
|
|
1412
|
+
'REVOKE ALL ON FUNCTION %I.create_xai_subscription_credential(uuid, uuid, text, text, text, text, text, text, text, timestamptz) FROM PUBLIC',
|
|
1413
|
+
${literal(schema)}
|
|
1414
|
+
);
|
|
1415
|
+
EXECUTE format(
|
|
1416
|
+
'GRANT EXECUTE ON FUNCTION %I.create_xai_subscription_credential(uuid, uuid, text, text, text, text, text, text, text, timestamptz) TO %I',
|
|
1417
|
+
${literal(schema)},
|
|
1418
|
+
${literal(role)}
|
|
1419
|
+
);
|
|
1420
|
+
EXECUTE format(
|
|
1421
|
+
'REVOKE ALL ON FUNCTION %I.disconnect_xai_subscription_credential(uuid, uuid, text, uuid, jsonb) FROM PUBLIC',
|
|
1422
|
+
${literal(schema)}
|
|
1423
|
+
);
|
|
1424
|
+
EXECUTE format(
|
|
1425
|
+
'GRANT EXECUTE ON FUNCTION %I.disconnect_xai_subscription_credential(uuid, uuid, text, uuid, jsonb) TO %I',
|
|
1426
|
+
${literal(schema)},
|
|
1427
|
+
${literal(role)}
|
|
1428
|
+
);
|
|
1429
|
+
EXECUTE format(
|
|
1430
|
+
'REVOKE ALL ON FUNCTION %I.resolve_xai_authority_pool(uuid, uuid, text, jsonb) FROM PUBLIC',
|
|
1431
|
+
${literal(schema)}
|
|
1432
|
+
);
|
|
1433
|
+
EXECUTE format(
|
|
1434
|
+
'GRANT EXECUTE ON FUNCTION %I.resolve_xai_authority_pool(uuid, uuid, text, jsonb) TO %I',
|
|
1435
|
+
${literal(schema)},
|
|
1436
|
+
${literal(role)}
|
|
1437
|
+
);
|
|
1438
|
+
EXECUTE format(
|
|
1439
|
+
'REVOKE ALL ON FUNCTION %I.revalidate_xai_subscription_authority(uuid, text, uuid, jsonb) FROM PUBLIC',
|
|
1440
|
+
${literal(schema)}
|
|
1441
|
+
);
|
|
1442
|
+
EXECUTE format(
|
|
1443
|
+
'GRANT EXECUTE ON FUNCTION %I.revalidate_xai_subscription_authority(uuid, text, uuid, jsonb) TO %I',
|
|
1444
|
+
${literal(schema)},
|
|
1445
|
+
${literal(role)}
|
|
1446
|
+
);
|
|
1447
|
+
EXECUTE format(
|
|
1448
|
+
'REVOKE ALL ON FUNCTION %I.xai_provider_account_authority_snapshot_v1_valid(jsonb) FROM PUBLIC',
|
|
1449
|
+
${literal(schema)}
|
|
1450
|
+
);
|
|
1451
|
+
EXECUTE format(
|
|
1452
|
+
'GRANT EXECUTE ON FUNCTION %I.xai_provider_account_authority_snapshot_v1_valid(jsonb) TO %I',
|
|
1453
|
+
${literal(schema)},
|
|
1454
|
+
${literal(role)}
|
|
1455
|
+
);
|
|
1456
|
+
EXECUTE format(
|
|
1457
|
+
'REVOKE ALL ON FUNCTION %I.xai_subscription_authority_live(uuid, uuid, text, uuid, text, uuid, uuid, bigint) FROM PUBLIC',
|
|
1458
|
+
${literal(schema)}
|
|
1459
|
+
);
|
|
1460
|
+
EXECUTE format(
|
|
1461
|
+
'GRANT EXECUTE ON FUNCTION %I.xai_subscription_authority_live(uuid, uuid, text, uuid, text, uuid, uuid, bigint) TO %I',
|
|
1462
|
+
${literal(schema)},
|
|
1463
|
+
${literal(role)}
|
|
1464
|
+
);
|
|
1465
|
+
EXECUTE format(
|
|
1466
|
+
'REVOKE ALL ON FUNCTION %I.xai_subscription_pool_visible(uuid, uuid, text, text, uuid) FROM PUBLIC',
|
|
1467
|
+
${literal(schema)}
|
|
1468
|
+
);
|
|
1469
|
+
EXECUTE format(
|
|
1470
|
+
'GRANT EXECUTE ON FUNCTION %I.xai_subscription_pool_visible(uuid, uuid, text, text, uuid) TO %I',
|
|
1471
|
+
${literal(schema)},
|
|
1472
|
+
${literal(role)}
|
|
1473
|
+
);
|
|
1474
|
+
END IF;
|
|
1475
|
+
IF to_regprocedure(
|
|
1476
|
+
format(
|
|
1477
|
+
'%I.resolve_session_attempt_personal_resources(uuid,uuid,uuid)',
|
|
1478
|
+
${literal(schema)}
|
|
1479
|
+
)
|
|
1480
|
+
) IS NOT NULL THEN
|
|
1481
|
+
EXECUTE format(
|
|
1482
|
+
'REVOKE ALL ON FUNCTION %I.resolve_session_attempt_personal_resources(uuid, uuid, uuid) FROM PUBLIC',
|
|
1483
|
+
${literal(schema)}
|
|
1484
|
+
);
|
|
1485
|
+
EXECUTE format(
|
|
1486
|
+
'GRANT EXECUTE ON FUNCTION %I.resolve_session_attempt_personal_resources(uuid, uuid, uuid) TO %I',
|
|
1487
|
+
${literal(schema)},
|
|
1488
|
+
${literal(role)}
|
|
1489
|
+
);
|
|
1490
|
+
END IF;
|
|
1491
|
+
IF to_regprocedure(
|
|
1492
|
+
format(
|
|
1493
|
+
'%I.accept_turn_personal_resource_attachment(uuid,uuid,uuid,uuid,text,integer,boolean,integer)',
|
|
1494
|
+
${literal(schema)}
|
|
1495
|
+
)
|
|
1496
|
+
) IS NOT NULL THEN
|
|
1497
|
+
EXECUTE format(
|
|
1498
|
+
'REVOKE ALL ON FUNCTION %I.accept_turn_personal_resource_attachment(uuid, uuid, uuid, uuid, text, integer, boolean, integer) FROM PUBLIC',
|
|
1499
|
+
${literal(schema)}
|
|
1500
|
+
);
|
|
1501
|
+
EXECUTE format(
|
|
1502
|
+
'GRANT EXECUTE ON FUNCTION %I.accept_turn_personal_resource_attachment(uuid, uuid, uuid, uuid, text, integer, boolean, integer) TO %I',
|
|
1503
|
+
${literal(schema)},
|
|
1504
|
+
${literal(role)}
|
|
1505
|
+
);
|
|
1506
|
+
END IF;
|
|
1507
|
+
IF to_regprocedure(format('%I.list_self_user_resource_authorities(uuid,uuid,text,uuid,integer)', ${literal(schema)}))
|
|
1508
|
+
IS NOT NULL THEN
|
|
1509
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_self_user_resource_authorities(uuid) FROM PUBLIC', ${literal(schema)});
|
|
1510
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_self_user_resource_authorities(uuid) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1511
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, boolean) FROM PUBLIC', ${literal(schema)});
|
|
1512
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, boolean) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1513
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.revoke_self_user_resource_grant(uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1514
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.revoke_self_user_resource_grant(uuid, uuid) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1515
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_self_user_resource_authorities(uuid, uuid, text, uuid, integer) FROM PUBLIC', ${literal(schema)});
|
|
1516
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_self_user_resource_authorities(uuid, uuid, text, uuid, integer) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1517
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, integer, boolean) FROM PUBLIC', ${literal(schema)});
|
|
1518
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, integer, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1519
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.revoke_self_user_resource_grant(uuid, uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1520
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.revoke_self_user_resource_grant(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1521
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.authorize_session_attempt_personal_resource_reads(uuid, uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1522
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.authorize_session_attempt_personal_resource_reads(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1523
|
+
END IF;
|
|
1524
|
+
IF to_regprocedure(format('%I.resolve_connection_use_authority(uuid,uuid,uuid,jsonb)', ${literal(schema)}))
|
|
1525
|
+
IS NOT NULL THEN
|
|
1526
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_self_connection_authorities(uuid) FROM PUBLIC', ${literal(schema)});
|
|
1527
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_self_connection_authorities(uuid) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1528
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.issue_self_connection_use_grant(uuid, uuid, uuid, text, text, uuid, boolean) FROM PUBLIC', ${literal(schema)});
|
|
1529
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.issue_self_connection_use_grant(uuid, uuid, uuid, text, text, uuid, boolean) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1530
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.revoke_self_connection_use_grant(uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1531
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.revoke_self_connection_use_grant(uuid, uuid) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1532
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.resolve_connection_use_authority(uuid, uuid, uuid, jsonb) FROM PUBLIC', ${literal(schema)});
|
|
1533
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.resolve_connection_use_authority(uuid, uuid, uuid, jsonb) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1534
|
+
IF to_regprocedure(format('%I.resolve_personal_connection_authority_selection(uuid,uuid,text,uuid,jsonb)', ${literal(schema)})) IS NOT NULL THEN
|
|
1535
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.resolve_personal_connection_authority_selection(uuid, uuid, text, uuid, jsonb) FROM PUBLIC', ${literal(schema)});
|
|
1536
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.resolve_personal_connection_authority_selection(uuid, uuid, text, uuid, jsonb) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1537
|
+
END IF;
|
|
1538
|
+
IF to_regprocedure(format('%I.resolve_accepted_connection_use(uuid,uuid,uuid,uuid,uuid,integer,uuid,text,text,uuid,text,text,text,text)', ${literal(schema)})) IS NOT NULL THEN
|
|
1539
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.resolve_accepted_connection_use(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, uuid, text, text, text, text) FROM PUBLIC', ${literal(schema)});
|
|
1540
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.resolve_accepted_connection_use(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, uuid, text, text, text, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1541
|
+
END IF;
|
|
1542
|
+
END IF;
|
|
1543
|
+
IF to_regprocedure(
|
|
1544
|
+
format('%I.get_self_personal_github_repository_selection(uuid,uuid,text,uuid)', ${literal(schema)})
|
|
1545
|
+
) IS NOT NULL THEN
|
|
1546
|
+
EXECUTE format(
|
|
1547
|
+
'REVOKE ALL ON FUNCTION %I.get_self_personal_github_repository_selection(uuid,uuid,text,uuid) FROM PUBLIC',
|
|
1548
|
+
${literal(schema)}
|
|
1549
|
+
);
|
|
1550
|
+
EXECUTE format(
|
|
1551
|
+
'GRANT EXECUTE ON FUNCTION %I.get_self_personal_github_repository_selection(uuid,uuid,text,uuid) TO %I',
|
|
1552
|
+
${literal(schema)}, ${literal(role)}
|
|
1553
|
+
);
|
|
1554
|
+
EXECUTE format(
|
|
1555
|
+
'REVOKE ALL ON FUNCTION %I.mutate_self_personal_github_repository_selection(uuid,uuid,text,uuid,bigint,bigint,text,jsonb,boolean) FROM PUBLIC',
|
|
1556
|
+
${literal(schema)}
|
|
1557
|
+
);
|
|
1558
|
+
EXECUTE format(
|
|
1559
|
+
'GRANT EXECUTE ON FUNCTION %I.mutate_self_personal_github_repository_selection(uuid,uuid,text,uuid,bigint,bigint,text,jsonb,boolean) TO %I',
|
|
1560
|
+
${literal(schema)}, ${literal(role)}
|
|
1561
|
+
);
|
|
1562
|
+
EXECUTE format(
|
|
1563
|
+
'REVOKE ALL PRIVILEGES ON TABLE %I.personal_github_repository_selection_heads, %I.personal_github_repository_selections, %I.personal_github_repository_selection_operations FROM %I',
|
|
1564
|
+
${literal(schema)}, ${literal(schema)}, ${literal(schema)}, ${literal(role)}
|
|
1565
|
+
);
|
|
1566
|
+
END IF;
|
|
1567
|
+
IF to_regprocedure(
|
|
1568
|
+
format('%I.create_personal_document_authority(uuid,uuid,uuid)', ${literal(schema)})
|
|
1569
|
+
) IS NOT NULL THEN
|
|
1570
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.create_personal_document_authority(uuid, uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1571
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.create_personal_document_authority(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1572
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.resolve_document_original_file(uuid, uuid, text, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1573
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.resolve_document_original_file(uuid, uuid, text, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1574
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.prepare_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1575
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.prepare_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid) FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1576
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.resolve_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1577
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.resolve_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1578
|
+
EXECUTE format('REVOKE ALL ON FUNCTION opengeni_private.personal_document_authority_capability_active(text) FROM PUBLIC');
|
|
1579
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION opengeni_private.personal_document_authority_capability_active(text) TO %I', ${literal(role)});
|
|
1580
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE opengeni_private.personal_document_authority_capabilities FROM %I', ${literal(role)});
|
|
1581
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.session_attempt_personal_document_admissions FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1582
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.session_attempt_personal_document_snapshots FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1583
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.personal_document_once_consumption_receipts FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1584
|
+
END IF;
|
|
1585
|
+
IF to_regprocedure(
|
|
1586
|
+
format('%I.reclassify_document_authority(jsonb)', ${literal(schema)})
|
|
1587
|
+
) IS NOT NULL THEN
|
|
1588
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.reclassify_document_authority(jsonb) FROM PUBLIC', ${literal(schema)});
|
|
1589
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.reclassify_document_authority(jsonb) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1590
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.list_document_authority_reclassifications(uuid, uuid, text, uuid, integer, timestamptz, uuid) FROM PUBLIC', ${literal(schema)});
|
|
1591
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_document_authority_reclassifications(uuid, uuid, text, uuid, integer, timestamptz, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1592
|
+
EXECUTE format('REVOKE ALL ON FUNCTION %I.run_document_default_collection_backfill(jsonb) FROM PUBLIC', ${literal(schema)});
|
|
1593
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.run_document_default_collection_backfill(jsonb) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1594
|
+
EXECUTE format('REVOKE ALL ON FUNCTION opengeni_private.document_migration_capability_active(text) FROM PUBLIC');
|
|
1595
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION opengeni_private.document_migration_capability_active(text) TO %I', ${literal(role)});
|
|
1596
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE opengeni_private.document_migration_capabilities FROM %I', ${literal(role)});
|
|
1597
|
+
EXECUTE format('GRANT SELECT ON TABLE %I.document_authority_reclassifications TO %I', ${literal(schema)}, ${literal(role)});
|
|
1598
|
+
EXECUTE format('REVOKE INSERT, UPDATE, DELETE ON TABLE %I.document_authority_reclassifications FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1599
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.document_default_collection_backfill_runs, %I.document_default_collection_backfill_operations, %I.document_default_collection_backfill_receipts FROM %I', ${literal(schema)}, ${literal(schema)}, ${literal(schema)}, ${literal(role)});
|
|
1600
|
+
END IF;
|
|
1601
|
+
IF to_regprocedure(
|
|
1602
|
+
format('%I.create_scoped_variable_set(uuid,uuid,text,text,text,jsonb,boolean)', ${literal(schema)})
|
|
1603
|
+
) IS NOT NULL THEN
|
|
1604
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.create_scoped_variable_set(uuid, uuid, text, text, text, jsonb, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1605
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_scoped_variable_sets(uuid, uuid, uuid, text, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1606
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.count_scoped_variable_sets(uuid, uuid, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1607
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.mutate_scoped_variable_set(uuid, uuid, uuid, text, text, boolean, text, boolean, text, text, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1608
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.read_scoped_variable_set_secret(uuid, uuid, uuid, text, text, text, uuid, uuid, uuid, integer) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1609
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.materialize_scoped_variable_set_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1610
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.materialize_scoped_variable_set_for_session(uuid, uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1611
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.workspace_variable_sets FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1612
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.workspace_variable_set_variables FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1613
|
+
END IF;
|
|
1614
|
+
IF to_regprocedure(
|
|
1615
|
+
format('%I.create_scoped_rig(uuid,uuid,text,text,text,text,jsonb,boolean)', ${literal(schema)})
|
|
1616
|
+
) IS NOT NULL THEN
|
|
1617
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.create_scoped_rig(uuid, uuid, text, text, text, text, jsonb, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1618
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_scoped_rigs(uuid, uuid, uuid, text, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1619
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.count_scoped_rigs(uuid, uuid, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1620
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.mutate_scoped_rig(uuid, uuid, uuid, text, text, boolean, text, boolean, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1621
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.finalize_scoped_enrollment(uuid, uuid, text, text, boolean, boolean, text, text, text, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1622
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_scoped_enrollments(uuid, uuid, uuid, text) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1623
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.get_scoped_sandbox(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1624
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.authorize_scoped_sandbox_attach(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1625
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.materialize_scoped_rig_version_for_attempt(uuid, uuid, uuid, uuid, uuid, integer) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1626
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.authorize_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1627
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.assert_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid, boolean) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1628
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.list_scoped_machine_dependent_sessions(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1629
|
+
EXECUTE format('GRANT EXECUTE ON FUNCTION %I.detach_scoped_machine_dependent_sessions(uuid, uuid, uuid) TO %I', ${literal(schema)}, ${literal(role)});
|
|
1630
|
+
EXECUTE format('REVOKE ALL PRIVILEGES ON TABLE %I.session_attempt_connected_machine_authorizations FROM %I', ${literal(schema)}, ${literal(role)});
|
|
1631
|
+
END IF;
|
|
1632
|
+
IF to_regprocedure(
|
|
1633
|
+
format(
|
|
1634
|
+
'%I.freeze_scheduled_task_personal_resources(uuid,uuid,uuid,bigint)',
|
|
1635
|
+
${literal(schema)}
|
|
1636
|
+
)
|
|
1637
|
+
) IS NOT NULL THEN
|
|
1638
|
+
EXECUTE format(
|
|
1639
|
+
'REVOKE ALL ON FUNCTION %I.freeze_scheduled_task_personal_resources(uuid, uuid, uuid, bigint) FROM PUBLIC',
|
|
1640
|
+
${literal(schema)}
|
|
1641
|
+
);
|
|
1642
|
+
EXECUTE format(
|
|
1643
|
+
'GRANT EXECUTE ON FUNCTION %I.freeze_scheduled_task_personal_resources(uuid, uuid, uuid, bigint) TO %I',
|
|
1644
|
+
${literal(schema)},
|
|
1645
|
+
${literal(role)}
|
|
1646
|
+
);
|
|
1647
|
+
EXECUTE format(
|
|
1648
|
+
'REVOKE ALL ON FUNCTION %I.clone_scheduled_task_personal_resource_authority(uuid, uuid, uuid, bigint, bigint) FROM PUBLIC',
|
|
1649
|
+
${literal(schema)}
|
|
1650
|
+
);
|
|
1651
|
+
EXECUTE format(
|
|
1652
|
+
'GRANT EXECUTE ON FUNCTION %I.clone_scheduled_task_personal_resource_authority(uuid, uuid, uuid, bigint, bigint) TO %I',
|
|
1653
|
+
${literal(schema)},
|
|
1654
|
+
${literal(role)}
|
|
1655
|
+
);
|
|
1656
|
+
IF to_regprocedure(
|
|
1657
|
+
format(
|
|
1658
|
+
'%I.refresh_scheduled_task_personal_resources_clone_connections(uuid,uuid,uuid,bigint,bigint)',
|
|
1659
|
+
${literal(schema)}
|
|
1660
|
+
)
|
|
1661
|
+
) IS NOT NULL THEN
|
|
1662
|
+
EXECUTE format(
|
|
1663
|
+
'REVOKE ALL ON FUNCTION %I.refresh_scheduled_task_personal_resources_clone_connections(uuid, uuid, uuid, bigint, bigint) FROM PUBLIC',
|
|
1664
|
+
${literal(schema)}
|
|
1665
|
+
);
|
|
1666
|
+
EXECUTE format(
|
|
1667
|
+
'GRANT EXECUTE ON FUNCTION %I.refresh_scheduled_task_personal_resources_clone_connections(uuid, uuid, uuid, bigint, bigint) TO %I',
|
|
1668
|
+
${literal(schema)}, ${literal(role)}
|
|
1669
|
+
);
|
|
1670
|
+
EXECUTE format(
|
|
1671
|
+
'REVOKE ALL ON FUNCTION %I.create_scheduled_agent_run_with_admission(uuid, uuid, uuid, uuid, bigint, text, text, text, timestamp with time zone, timestamp with time zone, jsonb) FROM PUBLIC',
|
|
1672
|
+
${literal(schema)}
|
|
1673
|
+
);
|
|
1674
|
+
EXECUTE format(
|
|
1675
|
+
'GRANT EXECUTE ON FUNCTION %I.create_scheduled_agent_run_with_admission(uuid, uuid, uuid, uuid, bigint, text, text, text, timestamp with time zone, timestamp with time zone, jsonb) TO %I',
|
|
1676
|
+
${literal(schema)}, ${literal(role)}
|
|
1677
|
+
);
|
|
1678
|
+
EXECUTE format(
|
|
1679
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_task_run_connection_authority_subject(uuid, uuid, uuid) FROM PUBLIC',
|
|
1680
|
+
${literal(schema)}
|
|
1681
|
+
);
|
|
1682
|
+
EXECUTE format(
|
|
1683
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_task_run_connection_authority_subject(uuid, uuid, uuid) TO %I',
|
|
1684
|
+
${literal(schema)}, ${literal(role)}
|
|
1685
|
+
);
|
|
1686
|
+
EXECUTE format(
|
|
1687
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_task_personal_resource_authority_subject(uuid, uuid, uuid, bigint) FROM PUBLIC',
|
|
1688
|
+
${literal(schema)}
|
|
1689
|
+
);
|
|
1690
|
+
EXECUTE format(
|
|
1691
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_task_personal_resource_authority_subject(uuid, uuid, uuid, bigint) TO %I',
|
|
1692
|
+
${literal(schema)}, ${literal(role)}
|
|
1693
|
+
);
|
|
1694
|
+
EXECUTE format(
|
|
1695
|
+
'REVOKE ALL ON FUNCTION %I.record_scheduled_task_revision_authority(uuid, uuid, uuid, bigint) FROM PUBLIC',
|
|
1696
|
+
${literal(schema)}
|
|
1697
|
+
);
|
|
1698
|
+
EXECUTE format(
|
|
1699
|
+
'GRANT EXECUTE ON FUNCTION %I.record_scheduled_task_revision_authority(uuid, uuid, uuid, bigint) TO %I',
|
|
1700
|
+
${literal(schema)}, ${literal(role)}
|
|
1701
|
+
);
|
|
1702
|
+
EXECUTE format(
|
|
1703
|
+
'REVOKE ALL ON FUNCTION %I.clone_scheduled_task_revision_authority(uuid, uuid, uuid, bigint, bigint) FROM PUBLIC',
|
|
1704
|
+
${literal(schema)}
|
|
1705
|
+
);
|
|
1706
|
+
EXECUTE format(
|
|
1707
|
+
'GRANT EXECUTE ON FUNCTION %I.clone_scheduled_task_revision_authority(uuid, uuid, uuid, bigint, bigint) TO %I',
|
|
1708
|
+
${literal(schema)}, ${literal(role)}
|
|
1709
|
+
);
|
|
1710
|
+
EXECUTE format(
|
|
1711
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_task_revision_authority_subject(uuid, uuid, uuid, bigint) FROM PUBLIC',
|
|
1712
|
+
${literal(schema)}
|
|
1713
|
+
);
|
|
1714
|
+
EXECUTE format(
|
|
1715
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_task_revision_authority_subject(uuid, uuid, uuid, bigint) TO %I',
|
|
1716
|
+
${literal(schema)}, ${literal(role)}
|
|
1717
|
+
);
|
|
1718
|
+
EXECUTE format(
|
|
1719
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_task_revision_authority_snapshot(uuid, uuid, uuid, bigint) FROM PUBLIC',
|
|
1720
|
+
${literal(schema)}
|
|
1721
|
+
);
|
|
1722
|
+
EXECUTE format(
|
|
1723
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_task_revision_authority_snapshot(uuid, uuid, uuid, bigint) TO %I',
|
|
1724
|
+
${literal(schema)}, ${literal(role)}
|
|
1725
|
+
);
|
|
1726
|
+
EXECUTE format(
|
|
1727
|
+
'REVOKE ALL ON FUNCTION %I.validate_scheduled_agent_run_live_authority(uuid, uuid, uuid) FROM PUBLIC',
|
|
1728
|
+
${literal(schema)}
|
|
1729
|
+
);
|
|
1730
|
+
EXECUTE format(
|
|
1731
|
+
'GRANT EXECUTE ON FUNCTION %I.validate_scheduled_agent_run_live_authority(uuid, uuid, uuid) TO %I',
|
|
1732
|
+
${literal(schema)}, ${literal(role)}
|
|
1733
|
+
);
|
|
1734
|
+
EXECUTE format(
|
|
1735
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_scoped_rig_version_metadata(uuid, uuid, text, uuid, uuid) FROM PUBLIC',
|
|
1736
|
+
${literal(schema)}
|
|
1737
|
+
);
|
|
1738
|
+
EXECUTE format(
|
|
1739
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_scoped_rig_version_metadata(uuid, uuid, text, uuid, uuid) TO %I',
|
|
1740
|
+
${literal(schema)}, ${literal(role)}
|
|
1741
|
+
);
|
|
1742
|
+
EXECUTE format(
|
|
1743
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_variable_set_expected_generation_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid) FROM PUBLIC',
|
|
1744
|
+
${literal(schema)}
|
|
1745
|
+
);
|
|
1746
|
+
EXECUTE format(
|
|
1747
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_variable_set_expected_generation_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid) TO %I',
|
|
1748
|
+
${literal(schema)}, ${literal(role)}
|
|
1749
|
+
);
|
|
1750
|
+
EXECUTE format(
|
|
1751
|
+
'REVOKE ALL ON FUNCTION %I.bind_scheduled_task_run_session(uuid, uuid, uuid, uuid) FROM PUBLIC',
|
|
1752
|
+
${literal(schema)}
|
|
1753
|
+
);
|
|
1754
|
+
EXECUTE format(
|
|
1755
|
+
'GRANT EXECUTE ON FUNCTION %I.bind_scheduled_task_run_session(uuid, uuid, uuid, uuid) TO %I',
|
|
1756
|
+
${literal(schema)}, ${literal(role)}
|
|
1757
|
+
);
|
|
1758
|
+
EXECUTE format(
|
|
1759
|
+
'REVOKE ALL ON FUNCTION %I.transition_scheduled_agent_run(uuid, uuid, uuid, uuid, uuid, text, text) FROM PUBLIC',
|
|
1760
|
+
${literal(schema)}
|
|
1761
|
+
);
|
|
1762
|
+
EXECUTE format(
|
|
1763
|
+
'GRANT EXECUTE ON FUNCTION %I.transition_scheduled_agent_run(uuid, uuid, uuid, uuid, uuid, text, text) TO %I',
|
|
1764
|
+
${literal(schema)}, ${literal(role)}
|
|
1765
|
+
);
|
|
1766
|
+
EXECUTE format(
|
|
1767
|
+
'REVOKE DELETE ON TABLE %I.scheduled_tasks, %I.scheduled_task_runs FROM %I',
|
|
1768
|
+
${literal(schema)}, ${literal(schema)}, ${literal(role)}
|
|
1769
|
+
);
|
|
1770
|
+
EXECUTE format(
|
|
1771
|
+
'REVOKE ALL PRIVILEGES ON TABLE %I.scheduled_task_connection_authority_snapshots FROM %I',
|
|
1772
|
+
${literal(schema)}, ${literal(role)}
|
|
1773
|
+
);
|
|
1774
|
+
EXECUTE format(
|
|
1775
|
+
'REVOKE ALL PRIVILEGES ON TABLE %I.scheduled_task_run_connection_authority_snapshots FROM %I',
|
|
1776
|
+
${literal(schema)}, ${literal(role)}
|
|
1777
|
+
);
|
|
1778
|
+
EXECUTE format(
|
|
1779
|
+
'REVOKE ALL PRIVILEGES ON TABLE %I.scheduled_task_reusable_connection_materializations FROM %I',
|
|
1780
|
+
${literal(schema)}, ${literal(role)}
|
|
1781
|
+
);
|
|
1782
|
+
EXECUTE format(
|
|
1783
|
+
'REVOKE ALL PRIVILEGES ON TABLE %I.scheduled_task_revision_authorities FROM %I',
|
|
1784
|
+
${literal(schema)}, ${literal(role)}
|
|
1785
|
+
);
|
|
1786
|
+
END IF;
|
|
1787
|
+
EXECUTE format(
|
|
1788
|
+
'REVOKE ALL ON FUNCTION %I.materialize_scheduled_task_reusable_session_from_run(uuid, uuid, uuid, uuid, uuid, bigint, text) FROM PUBLIC',
|
|
1789
|
+
${literal(schema)}
|
|
1790
|
+
);
|
|
1791
|
+
EXECUTE format(
|
|
1792
|
+
'GRANT EXECUTE ON FUNCTION %I.materialize_scheduled_task_reusable_session_from_run(uuid, uuid, uuid, uuid, uuid, bigint, text) TO %I',
|
|
1793
|
+
${literal(schema)},
|
|
1794
|
+
${literal(role)}
|
|
1795
|
+
);
|
|
1796
|
+
EXECUTE format(
|
|
1797
|
+
'REVOKE ALL ON FUNCTION %I.scheduled_task_run_personal_resource_authority(uuid, uuid, uuid) FROM PUBLIC',
|
|
1798
|
+
${literal(schema)}
|
|
1799
|
+
);
|
|
1800
|
+
EXECUTE format(
|
|
1801
|
+
'GRANT EXECUTE ON FUNCTION %I.scheduled_task_run_personal_resource_authority(uuid, uuid, uuid) TO %I',
|
|
1802
|
+
${literal(schema)},
|
|
955
1803
|
${literal(role)}
|
|
956
1804
|
);
|
|
957
1805
|
END IF;
|
|
@@ -1014,6 +1862,48 @@ BEGIN
|
|
|
1014
1862
|
owner_role,
|
|
1015
1863
|
${literal(role)}
|
|
1016
1864
|
);
|
|
1865
|
+
IF to_regprocedure('opengeni_private.personal_resource_delegation_capability_active(text)') IS NOT NULL THEN
|
|
1866
|
+
REVOKE ALL ON FUNCTION
|
|
1867
|
+
opengeni_private.personal_resource_delegation_capability_active(text)
|
|
1868
|
+
FROM PUBLIC;
|
|
1869
|
+
EXECUTE format(
|
|
1870
|
+
'GRANT EXECUTE ON FUNCTION opengeni_private.personal_resource_delegation_capability_active(text) TO %I',
|
|
1871
|
+
${literal(role)}
|
|
1872
|
+
);
|
|
1873
|
+
END IF;
|
|
1874
|
+
IF to_regprocedure('opengeni_private.scheduled_personal_resource_capability_active(text)') IS NOT NULL THEN
|
|
1875
|
+
REVOKE ALL ON FUNCTION
|
|
1876
|
+
opengeni_private.scheduled_personal_resource_capability_active(text)
|
|
1877
|
+
FROM PUBLIC;
|
|
1878
|
+
EXECUTE format(
|
|
1879
|
+
'GRANT EXECUTE ON FUNCTION opengeni_private.scheduled_personal_resource_capability_active(text) TO %I',
|
|
1880
|
+
${literal(role)}
|
|
1881
|
+
);
|
|
1882
|
+
END IF;
|
|
1883
|
+
IF to_regprocedure('opengeni_private.variable_set_authority_capability_active(text)') IS NOT NULL THEN
|
|
1884
|
+
REVOKE ALL ON FUNCTION
|
|
1885
|
+
opengeni_private.variable_set_authority_capability_active(text)
|
|
1886
|
+
FROM PUBLIC;
|
|
1887
|
+
EXECUTE format(
|
|
1888
|
+
'GRANT EXECUTE ON FUNCTION opengeni_private.variable_set_authority_capability_active(text) TO %I',
|
|
1889
|
+
${literal(role)}
|
|
1890
|
+
);
|
|
1891
|
+
EXECUTE format(
|
|
1892
|
+
'REVOKE ALL PRIVILEGES ON TABLE opengeni_private.variable_set_authority_capabilities FROM %I',
|
|
1893
|
+
${literal(role)}
|
|
1894
|
+
);
|
|
1895
|
+
END IF;
|
|
1896
|
+
IF to_regprocedure('opengeni_private.scoped_compute_capability_active(text)') IS NOT NULL THEN
|
|
1897
|
+
REVOKE ALL ON FUNCTION opengeni_private.scoped_compute_capability_active(text) FROM PUBLIC;
|
|
1898
|
+
EXECUTE format(
|
|
1899
|
+
'GRANT EXECUTE ON FUNCTION opengeni_private.scoped_compute_capability_active(text) TO %I',
|
|
1900
|
+
${literal(role)}
|
|
1901
|
+
);
|
|
1902
|
+
EXECUTE format(
|
|
1903
|
+
'REVOKE ALL PRIVILEGES ON TABLE opengeni_private.scoped_compute_capabilities FROM %I',
|
|
1904
|
+
${literal(role)}
|
|
1905
|
+
);
|
|
1906
|
+
END IF;
|
|
1017
1907
|
-- Global cross-workspace artifact workers are separate capabilities. Never
|
|
1018
1908
|
-- let the generic tenant-scoped app role inherit them from the historical
|
|
1019
1909
|
-- blanket grant of already-installed helpers.
|
|
@@ -1085,6 +1975,23 @@ BEGIN
|
|
|
1085
1975
|
${literal(role)}
|
|
1086
1976
|
);
|
|
1087
1977
|
END IF;
|
|
1978
|
+
FOREACH routine_signature IN ARRAY ARRAY[
|
|
1979
|
+
'complete_temporal_schedule_connector_cleanup(uuid,uuid)',
|
|
1980
|
+
'upgrade_temporal_schedule_connector_cleanup(uuid,uuid,text,uuid,text,jsonb,uuid)',
|
|
1981
|
+
'complete_workspace_temporal_connector_cleanups(uuid,uuid)'
|
|
1982
|
+
] LOOP
|
|
1983
|
+
IF to_regprocedure('opengeni_private.' || routine_signature) IS NOT NULL THEN
|
|
1984
|
+
EXECUTE format(
|
|
1985
|
+
'REVOKE ALL ON FUNCTION opengeni_private.%s FROM PUBLIC',
|
|
1986
|
+
routine_signature
|
|
1987
|
+
);
|
|
1988
|
+
EXECUTE format(
|
|
1989
|
+
'GRANT EXECUTE ON FUNCTION opengeni_private.%s TO %I',
|
|
1990
|
+
routine_signature,
|
|
1991
|
+
${literal(role)}
|
|
1992
|
+
);
|
|
1993
|
+
END IF;
|
|
1994
|
+
END LOOP;
|
|
1088
1995
|
END IF;
|
|
1089
1996
|
END $$;
|
|
1090
1997
|
`);
|