-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
270 additions
and
255 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,43 @@ | ||
import {Prisma} from '@prisma/client'; | ||
import { Prisma } from '@prisma/client'; | ||
import { | ||
NONE_EXAM_DOCUMENT_ID, | ||
RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID | ||
} from "./document-roots"; | ||
import {TEST_USER_ID} from "./users"; | ||
import {Access} from "@prisma/client"; | ||
import {CLASS_GROUP_ID, PROJECT_GROUP_ID} from "./student-groups"; | ||
NONE_EXAM_DOCUMENT_ID, | ||
RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, | ||
RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID | ||
} from './document-roots'; | ||
import { TEST_USER_ID } from './users'; | ||
import { Access } from '@prisma/client'; | ||
import { CLASS_GROUP_ID, PROJECT_GROUP_ID } from './student-groups'; | ||
|
||
const rootUserPermissions: Prisma.RootUserPermissionCreateManyInput[] = [ | ||
{ | ||
documentRootId: RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID, | ||
userId: TEST_USER_ID, | ||
access: Access.RO}, | ||
{ | ||
documentRootId: NONE_EXAM_DOCUMENT_ID, | ||
userId: TEST_USER_ID, | ||
access: Access.None | ||
}, | ||
{ | ||
documentRootId: RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID, | ||
userId: TEST_USER_ID, | ||
access: Access.RO | ||
}, | ||
{ | ||
documentRootId: NONE_EXAM_DOCUMENT_ID, | ||
userId: TEST_USER_ID, | ||
access: Access.None | ||
} | ||
]; | ||
|
||
const rootGroupPermissions: Prisma.RootGroupPermissionCreateManyInput[] = [ | ||
{ | ||
documentRootId: RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, | ||
studentGroupId: CLASS_GROUP_ID, | ||
access: Access.RO | ||
}, | ||
{ | ||
documentRootId: NONE_EXAM_DOCUMENT_ID, | ||
studentGroupId: CLASS_GROUP_ID, | ||
access: Access.RW | ||
}, | ||
{ | ||
documentRootId: RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
studentGroupId: PROJECT_GROUP_ID, | ||
access: Access.None | ||
}, | ||
{ | ||
documentRootId: RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, | ||
studentGroupId: CLASS_GROUP_ID, | ||
access: Access.RO | ||
}, | ||
{ | ||
documentRootId: NONE_EXAM_DOCUMENT_ID, | ||
studentGroupId: CLASS_GROUP_ID, | ||
access: Access.RW | ||
}, | ||
{ | ||
documentRootId: RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
studentGroupId: PROJECT_GROUP_ID, | ||
access: Access.None | ||
} | ||
]; | ||
|
||
export {rootUserPermissions, rootGroupPermissions}; | ||
export { rootUserPermissions, rootGroupPermissions }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import {Access, Prisma} from "@prisma/client"; | ||
import { Access, Prisma } from '@prisma/client'; | ||
|
||
export const RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID = 'aa5b991b-ea21-450f-870d-55f2b9f1fac8'; | ||
export const RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID = 'ff8aa31c-65df-4651-af6a-06751ccec77f'; | ||
export const NONE_EXAM_DOCUMENT_ID = 'd50cdcba-adfc-41fa-a1d1-7a026f86b12b'; | ||
export const RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID = '2b7c4da1-b909-4990-a13a-51b0ab2c1517'; | ||
|
||
const documentRoots: Prisma.DocumentRootCreateInput[] = [ | ||
{ | ||
id: RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID, | ||
access: Access.RW, | ||
}, | ||
{ | ||
id: RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, | ||
access: Access.RW, | ||
}, | ||
{ | ||
id: NONE_EXAM_DOCUMENT_ID, | ||
access: Access.None, | ||
}, | ||
{ | ||
id: RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
access: Access.RO, | ||
}, | ||
{ | ||
id: RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID, | ||
access: Access.RW | ||
}, | ||
{ | ||
id: RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID, | ||
access: Access.RW | ||
}, | ||
{ | ||
id: NONE_EXAM_DOCUMENT_ID, | ||
access: Access.None | ||
}, | ||
{ | ||
id: RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID, | ||
access: Access.RO | ||
} | ||
]; | ||
|
||
export { documentRoots }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import {FOO_BAR_ID, TEST_USER_ID} from "./users"; | ||
import {Prisma} from "@prisma/client"; | ||
import { FOO_BAR_ID, TEST_USER_ID } from './users'; | ||
import { Prisma } from '@prisma/client'; | ||
|
||
export const ALL_USERS_GROUP_ID = '8f60f838-940a-4ab3-bb65-405308b0db6c'; | ||
export const CLASS_GROUP_ID = '106c9621-aed4-4592-a267-0670b5fe420c'; | ||
export const PROJECT_GROUP_ID = '58b696a3-7a6c-4745-ae4b-802158af2395'; | ||
|
||
const studentGroups: Prisma.StudentGroupUncheckedCreateWithoutChildrenInput[] = [ | ||
{ | ||
name: 'All Users', | ||
description: 'All seeded users', | ||
id: ALL_USERS_GROUP_ID, | ||
}, | ||
{ | ||
name: 'Test Class', | ||
description: 'A school class consisting of all seeded test users (test@user.ch and foo@bar.ch)', | ||
id: CLASS_GROUP_ID, | ||
}, | ||
{ | ||
name: 'Project group A', | ||
description: 'A project group within Test Class, including foo@bar.ch, but not test@user.ch', | ||
id: PROJECT_GROUP_ID, | ||
parentId: CLASS_GROUP_ID, | ||
} | ||
{ | ||
name: 'All Users', | ||
description: 'All seeded users', | ||
id: ALL_USERS_GROUP_ID | ||
}, | ||
{ | ||
name: 'Test Class', | ||
description: 'A school class consisting of all seeded test users (test@user.ch and foo@bar.ch)', | ||
id: CLASS_GROUP_ID | ||
}, | ||
{ | ||
name: 'Project group A', | ||
description: 'A project group within Test Class, including foo@bar.ch, but not test@user.ch', | ||
id: PROJECT_GROUP_ID, | ||
parentId: CLASS_GROUP_ID | ||
} | ||
]; | ||
|
||
export {studentGroups}; | ||
export { studentGroups }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.