11import { Prisma } from '@prisma/client' ;
22import { FOO_BAR_ID , TEST_USER_ID } from './users' ;
3- import {
4- NONE_EXAM_DOCUMENT_ID ,
5- RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID ,
6- RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID ,
7- RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID
8- } from './document-roots' ;
93
104const { USER_EMAIL , USER_ID } = process . env ;
115
@@ -17,105 +11,6 @@ export const FOO_BAR_EXAM_DOCUMENT_ID = '3fa55e05-6e82-4a86-922a-81b25325db69';
1711export const FOO_BAR_VISIBILITY_WRAPPER_DOCUMENT_ID = 'bb1d0183-1640-46ef-9fa2-d4a37ae7714d' ;
1812export const TEST_USER_VISIBILITY_WRAPPER_DOCUMENT_ID = 'b0b0baf9-e9ef-47c0-be59-5108915528d3' ;
1913
20- const documents : Prisma . DocumentCreateManyInput [ ] = [
21- {
22- id : FOO_BAR_EXERCISE_LOREM_DOCUMENT_ID ,
23- authorId : FOO_BAR_ID , // foo@bar .ch
24- documentRootId : RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID ,
25- type : 'text' ,
26- data : {
27- text :
'This is the Lorem exercise from [email protected] . They should be able to edit this document.' 28- }
29- } ,
30- {
31- id : TEST_USER_EXERCISE_LOREM_DOCUMENT_ID ,
32- authorId : TEST_USER_ID , // test@user .ch
33- documentRootId : RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID ,
34- type : 'text' ,
35- data : {
36- text :
'This is the Lorem exercise from [email protected] . They should be able to edit this document because their user permission is set to RO.' 37- }
38- } ,
39- {
40- id : FOO_BAR_EXERCISE_IMPSUM_DOCUMENT_ID ,
41- authorId : FOO_BAR_ID , // foo@bar .ch
42- documentRootId : RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID ,
43- type : 'text' ,
44- data : {
45- text :
'This is the Ipsum exercise from [email protected] . This document should be read-only for them, because their class has RO permission.' 46- }
47- } ,
48- {
49- id : TEST_USER_EXERCISE_IPSUM_DOCUMENT_ID ,
50- authorId : TEST_USER_ID , // test@user .ch
51- documentRootId : RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID ,
52- type : 'text' ,
53- data : {
54- text :
'This is the Ipsum exercise from [email protected] . This document should be read-only for them, because their class has RO permission.' 55- }
56- } ,
57- {
58- id : FOO_BAR_EXAM_DOCUMENT_ID ,
59- authorId : FOO_BAR_ID , // foo@bar .ch
60- documentRootId : NONE_EXAM_DOCUMENT_ID ,
61- type : 'text' ,
62- data : {
63- text :
'This is the exam from [email protected] . They should be able to edit it, because their class has RW permission.' 64- }
65- } ,
66- {
67- id : FOO_BAR_VISIBILITY_WRAPPER_DOCUMENT_ID ,
68- authorId : FOO_BAR_ID , // foo@bar .ch
69- documentRootId : RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID ,
70- type : 'text' ,
71- data : {
72- text :
'This is a visibility wrapper for [email protected] . This document should be read-only for them, indicating that they can see the wrapped resource (but cannot change this document).' 73- }
74- } ,
75- {
76- id : TEST_USER_VISIBILITY_WRAPPER_DOCUMENT_ID ,
77- authorId : TEST_USER_ID , // test@user .ch
78- documentRootId : RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID ,
79- type : 'text' ,
80- data : {
81- text :
'This is a visibility wrapper for [email protected] . They should not see this document, because their project group has None permission, indicating that they cannot see the wrapped resource.' 82- }
83- }
84- ] ;
85-
86- if ( USER_EMAIL && USER_ID ) {
87- documents . push ( {
88- authorId : USER_ID ,
89- documentRootId : RW_EXERCISE_LOREM_DOCUMENT_ROOT_ID ,
90- type : 'text' ,
91- data : {
92- text : `This is the Lorem exercise from ${ USER_EMAIL } `
93- }
94- } ) ;
95- documents . push ( {
96- authorId : USER_ID ,
97- documentRootId : RW_EXERCISE_IMPSUM_DOCUMENT_ROOT_ID ,
98- type : 'text' ,
99- data : {
100- text : `This is the Ipsum exercise from ${ USER_EMAIL } `
101- }
102- } ) ;
103- documents . push ( {
104- authorId : USER_ID ,
105- documentRootId : NONE_EXAM_DOCUMENT_ID ,
106- type : 'text' ,
107- data : {
108- text : `This is the exam document from ${ USER_EMAIL } `
109- }
110- } ) ;
111- documents . push ( {
112- authorId : USER_ID ,
113- documentRootId : RO_VISIBILITY_WRAPPER_DOCUMENT_ROOT_ID ,
114- type : 'text' ,
115- data : {
116- text : `This is the visibility wrapper document from ${ USER_EMAIL } `
117- }
118- } ) ;
119- }
14+ const documents : Prisma . DocumentCreateManyInput [ ] = [ ] ;
12015
12116export { documents } ;
0 commit comments