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:
@@ -33,7 +33,7 @@ describe("constructBoardPermissions", () => {
|
||||
expect(result.hasViewAccess).toBe(true);
|
||||
});
|
||||
|
||||
test("should return hasFullAccess as true when session permissions include board-full-access", () => {
|
||||
test("should return hasFullAccess as true when session permissions include board-full-all", () => {
|
||||
// Arrange
|
||||
const board = {
|
||||
creator: {
|
||||
@@ -46,7 +46,7 @@ describe("constructBoardPermissions", () => {
|
||||
const session = {
|
||||
user: {
|
||||
id: "2",
|
||||
permissions: getPermissionsWithChildren(["board-full-access"]),
|
||||
permissions: getPermissionsWithChildren(["board-full-all"]),
|
||||
},
|
||||
expires: new Date().toISOString(),
|
||||
} satisfies Session;
|
||||
@@ -87,14 +87,14 @@ describe("constructBoardPermissions", () => {
|
||||
expect(result.hasViewAccess).toBe(true);
|
||||
});
|
||||
|
||||
test('should return hasChangeAccess as true when board user permissions include "board-change"', () => {
|
||||
test('should return hasChangeAccess as true when board user permissions include "modify"', () => {
|
||||
// Arrange
|
||||
const board = {
|
||||
creator: {
|
||||
id: "1",
|
||||
},
|
||||
|
||||
userPermissions: [{ permission: "board-change" }],
|
||||
userPermissions: [{ permission: "modify" as const }],
|
||||
groupPermissions: [],
|
||||
isPublic: false,
|
||||
};
|
||||
@@ -115,14 +115,14 @@ describe("constructBoardPermissions", () => {
|
||||
expect(result.hasViewAccess).toBe(true);
|
||||
});
|
||||
|
||||
test("should return hasChangeAccess as true when board group permissions include board-change", () => {
|
||||
test("should return hasChangeAccess as true when board group permissions include modify", () => {
|
||||
// Arrange
|
||||
const board = {
|
||||
creator: {
|
||||
id: "1",
|
||||
},
|
||||
userPermissions: [],
|
||||
groupPermissions: [{ permission: "board-change" }],
|
||||
groupPermissions: [{ permission: "modify" as const }],
|
||||
isPublic: false,
|
||||
};
|
||||
const session = {
|
||||
@@ -175,7 +175,7 @@ describe("constructBoardPermissions", () => {
|
||||
creator: {
|
||||
id: "1",
|
||||
},
|
||||
userPermissions: [{ permission: "board-view" }],
|
||||
userPermissions: [{ permission: "view" as const }],
|
||||
groupPermissions: [],
|
||||
isPublic: false,
|
||||
};
|
||||
@@ -203,7 +203,7 @@ describe("constructBoardPermissions", () => {
|
||||
id: "1",
|
||||
},
|
||||
userPermissions: [],
|
||||
groupPermissions: [{ permission: "board-view" }],
|
||||
groupPermissions: [{ permission: "view" as const }],
|
||||
isPublic: false,
|
||||
};
|
||||
const session = {
|
||||
|
||||
Reference in New Issue
Block a user