mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-29 18:59:20 +01:00
* 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
18 lines
791 B
SQL
18 lines
791 B
SQL
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
|
|
);
|