feat: add integration access settings (#725)
* feat: add integration access settings * fix: typecheck and test issues * fix: test timeout * chore: address pull request feedback * chore: add throw if action forbidden for integration permissions * fix: unable to create new migrations because of duplicate prevId in sqlite snapshots * chore: add sqlite migration for integration permissions * test: add unit tests for integration access * test: add permission checks to integration router tests * test: add unit test for integration permissions * chore: add mysql migration * fix: format issues
This commit is contained in:
17
packages/db/migrations/sqlite/0004_peaceful_red_ghost.sql
Normal file
17
packages/db/migrations/sqlite/0004_peaceful_red_ghost.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE `integrationGroupPermissions` (
|
||||
`integration_id` text NOT NULL,
|
||||
`group_id` text NOT NULL,
|
||||
`permission` text NOT NULL,
|
||||
PRIMARY KEY(`group_id`, `integration_id`, `permission`),
|
||||
FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`group_id`) REFERENCES `group`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `integrationUserPermission` (
|
||||
`integration_id` text NOT NULL,
|
||||
`user_id` text NOT NULL,
|
||||
`permission` text NOT NULL,
|
||||
PRIMARY KEY(`integration_id`, `permission`, `user_id`),
|
||||
FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
@@ -2,7 +2,7 @@
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "5ad60251-8450-437d-9081-a456884120d2",
|
||||
"prevId": "0575873a-9e10-4480-8d7d-c47198622c22",
|
||||
"prevId": "2ed0ffc3-8612-42e7-bd8e-f5f8f3338a39",
|
||||
"tables": {
|
||||
"account": {
|
||||
"name": "account",
|
||||
|
||||
1263
packages/db/migrations/sqlite/meta/0004_snapshot.json
Normal file
1263
packages/db/migrations/sqlite/meta/0004_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,13 @@
|
||||
"when": 1716148434186,
|
||||
"tag": "0003_adorable_raider",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "6",
|
||||
"when": 1720036615408,
|
||||
"tag": "0004_peaceful_red_ghost",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user