Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 70 additions & 4 deletions db/canonical-baseline/R__database_runtime_grants.sql
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."notifications" TO id
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_accounts" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_bootstrap_receipts" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_case_command_receipts" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_login_credentials" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_role_assignments" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_sessions" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_consumer_receipts" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_delivery_attempts" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_messages" TO idea2strategy_backend;
Expand All @@ -389,6 +391,8 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."roles" TO idea2strat
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."bot_current_projections" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."bot_snapshots" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."series_manifests" TO idea2strategy_backend;
GRANT SELECT ON TABLE "storage"."backtest_attempt_cleanup_capabilities" TO idea2strategy_backend;
GRANT SELECT ON TABLE "storage"."backtest_object_ownerships" TO idea2strategy_backend;
GRANT SELECT ON TABLE "storage"."objects" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "strategy"."compiled_flow_plans" TO idea2strategy_backend;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "strategy"."element_catalog_versions" TO idea2strategy_backend;
Expand Down Expand Up @@ -478,8 +482,8 @@ GRANT SELECT ON TABLE "competition"."backtest_period_datasets" TO idea2strategy_
GRANT SELECT ON TABLE "competition"."backtest_period_feature_materializations" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE ON TABLE "competition"."backtest_period_runs" TO idea2strategy_batch;
GRANT SELECT, INSERT ON TABLE "competition"."leaderboard_entries" TO idea2strategy_batch;
GRANT SELECT, INSERT ON TABLE "competition"."leaderboard_snapshots" TO idea2strategy_batch;
GRANT SELECT, INSERT ON TABLE "competition"."live_evaluation_segments" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE ON TABLE "competition"."leaderboard_snapshots" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE ON TABLE "competition"."live_evaluation_segments" TO idea2strategy_batch;
GRANT SELECT ON TABLE "competition"."live_room_rules" TO idea2strategy_batch;
GRANT SELECT, INSERT ON TABLE "competition"."participation_events" TO idea2strategy_batch;
GRANT SELECT, UPDATE ON TABLE "competition"."participations" TO idea2strategy_batch;
Expand Down Expand Up @@ -565,7 +569,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."notifications" TO id
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_accounts" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_bootstrap_receipts" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_case_command_receipts" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_login_credentials" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_role_assignments" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_sessions" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_consumer_receipts" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_delivery_attempts" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_messages" TO idea2strategy_batch;
Expand All @@ -580,6 +586,8 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."roles" TO idea2strat
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."bot_current_projections" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."bot_snapshots" TO idea2strategy_batch;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "performance"."series_manifests" TO idea2strategy_batch;
GRANT SELECT ON TABLE "storage"."backtest_attempt_cleanup_capabilities" TO idea2strategy_batch;
GRANT SELECT ON TABLE "storage"."backtest_object_ownerships" TO idea2strategy_batch;
GRANT SELECT ON TABLE "storage"."objects" TO idea2strategy_batch;
GRANT SELECT ON TABLE "strategy"."compiled_flow_plans" TO idea2strategy_batch;
GRANT SELECT ON TABLE "strategy"."element_catalog_versions" TO idea2strategy_batch;
Expand Down Expand Up @@ -686,7 +694,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."notifications" TO id
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_accounts" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_bootstrap_receipts" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_case_command_receipts" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_login_credentials" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_role_assignments" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."operator_sessions" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_consumer_receipts" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_delivery_attempts" TO idea2strategy_trading;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE "operations"."outbox_messages" TO idea2strategy_trading;
Expand Down Expand Up @@ -757,7 +767,7 @@ GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."input_feature_materializations
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."legacy_execution_policy_mappings" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."monthly_judgment_summaries" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."performance_summaries" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."run_attempts" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "backtest"."run_attempts" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."run_input_pins" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "backtest"."runs" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "bot"."bots" TO idea2strategy_backtest;
Expand All @@ -780,7 +790,7 @@ GRANT SELECT ON TABLE "market_data"."stream_watermarks" TO idea2strategy_backtes
GRANT SELECT ON TABLE "market_data"."trading_sessions" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "operations"."outbox_consumer_receipts" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "operations"."outbox_messages" TO idea2strategy_backtest;
GRANT SELECT, INSERT, UPDATE ON TABLE "storage"."objects" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "storage"."objects" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "strategy"."compiled_flow_plans" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "strategy"."element_catalog_versions" TO idea2strategy_backtest;
GRANT SELECT ON TABLE "strategy"."element_definitions" TO idea2strategy_backtest;
Expand Down Expand Up @@ -820,3 +830,59 @@ GRANT SELECT, INSERT ON TABLE "storage"."objects" TO idea2strategy_pipeline;
GRANT USAGE ON SCHEMA "market_data" TO idea2strategy_pipeline;
GRANT USAGE ON SCHEMA "operations" TO idea2strategy_pipeline;
GRANT USAGE ON SCHEMA "storage" TO idea2strategy_pipeline;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM PUBLIC;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "storage"."prepare_backtest_object_cleanup"(jsonb) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM PUBLIC;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "storage"."reissue_backtest_object_cleanup"(jsonb, text) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM PUBLIC;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "backtest"."claim_run_attempt"(uuid, text, text, bigint) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM PUBLIC;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "backtest"."heartbeat_run_attempt"(uuid, uuid, bigint) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM PUBLIC;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "backtest"."close_run_attempt"(uuid, uuid, text, text, text, boolean) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM PUBLIC;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "backtest"."recover_expired_run_attempt"(uuid, text, text) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM PUBLIC;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."register_backtest_object"(jsonb) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "storage"."register_backtest_object"(jsonb) TO idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM PUBLIC;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM idea2strategy_backend;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM idea2strategy_batch;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM idea2strategy_trading;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM idea2strategy_backtest;
REVOKE ALL ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) FROM idea2strategy_pipeline;
GRANT EXECUTE ON FUNCTION "storage"."transition_backtest_object"(uuid, text, timestamp with time zone) TO idea2strategy_backtest;
Loading
Loading