|
| 1 | +-- Modify "api_tokens" table |
| 2 | +ALTER TABLE "api_tokens" ADD COLUMN "policies" jsonb NULL; |
| 3 | +-- Populate existing tokens with default policies |
| 4 | +UPDATE "api_tokens" SET "policies" = '[ |
| 5 | + {"Resource": "workflow_run", "Action": "list"}, |
| 6 | + {"Resource": "workflow_run", "Action": "read"}, |
| 7 | + {"Resource": "workflow", "Action": "read"}, |
| 8 | + {"Resource": "workflow", "Action": "list"}, |
| 9 | + {"Resource": "workflow", "Action": "create"}, |
| 10 | + {"Resource": "workflow_contract", "Action": "list"}, |
| 11 | + {"Resource": "workflow_contract", "Action": "read"}, |
| 12 | + {"Resource": "workflow_contract", "Action": "update"}, |
| 13 | + {"Resource": "workflow_contract", "Action": "create"}, |
| 14 | + {"Resource": "cas_artifact", "Action": "read"}, |
| 15 | + {"Resource": "referrer", "Action": "read"}, |
| 16 | + {"Resource": "organization", "Action": "read"}, |
| 17 | + {"Resource": "robot_account", "Action": "create"}, |
| 18 | + {"Resource": "integration_available", "Action": "read"}, |
| 19 | + {"Resource": "integration_available", "Action": "list"}, |
| 20 | + {"Resource": "integration_registered", "Action": "list"}, |
| 21 | + {"Resource": "integration_registered", "Action": "read"}, |
| 22 | + {"Resource": "integration_registered", "Action": "create"}, |
| 23 | + {"Resource": "integration_attached", "Action": "list"}, |
| 24 | + {"Resource": "integration_attached", "Action": "create"}, |
| 25 | + {"Resource": "cas_artifact", "Action": "create"} |
| 26 | +]'::jsonb WHERE "policies" IS NULL; |
0 commit comments