@@ -186,7 +186,7 @@ model Author {
186186 // Hide author if the member behind it is currently stab, or if it was posted as a "stab" mandate, AND user does not "see staben"
187187 // There is one exception: If the author is of type "Custom Author" then it is fine to show, as the person behind it is not shown
188188 @@deny("read" , type != "Custom" && (
189- startsWith(mandate.positionId, "dsek.noll.stab." )
189+ startsWith(mandate.positionId, "dsek.noll.stab." )
190190 || member.mandates?[startDate < now() && now() < endDate && (startsWith(positionId, "dsek.noll.stab." ))]
191191 ) && !has(auth().policies, "member:see_staben" ) && auth().memberId != memberId)
192192}
@@ -512,7 +512,7 @@ model Mandate {
512512 authors Author[]
513513 member Member @relation(fields: [memberId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "mandates_member_id_foreign" )
514514 position Position @relation(fields: [positionId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "mandates_position_id_foreign" )
515-
515+
516516 // Used on phadder mandates to connect to the phadder group
517517 phadderInId String ? @db.Uuid @allow("update" , auth().memberId == memberId || has(auth().policies, "nollning:phaddrar:groups:manage" ))
518518 phadderIn PhadderGroup? @relation(fields: [phadderInId], references: [id], onDelete: SetNull, onUpdate: NoAction)
@@ -819,6 +819,7 @@ model Song {
819819 createdAt DateTime ? @map("created_at" ) @db.Timestamptz(6)
820820 updatedAt DateTime ? @map("updated_at" ) @db.Timestamptz(6)
821821 deletedAt DateTime ? @map("deleted_at" ) @db.Timestamptz(6)
822+ video String ?
822823
823824 @@allow("create" , has(auth().policies, "song:create" ))
824825 @@allow("read" , has(auth().policies, "song:read" ))
@@ -948,8 +949,8 @@ model Shoppable {
948949 @@allow("update" , auth().memberId == authorId || has(auth().policies, "webshop:manage" ))
949950
950951 // I would like to do something like this but it is not possible because has(list: Any[], literal: Any) requires a literal
951- // @@allow("read", isEmpty(accessPolicies) ||
952- // accessPolicies?[exists(role != null && has(auth().roles, role)) ||
952+ // @@allow("read", isEmpty(accessPolicies) ||
953+ // accessPolicies?[exists(role != null && has(auth().roles, role)) ||
953954 // (studentId != null && auth().studentId == studentId)])
954955 @@allow("read" , true )
955956
@@ -1155,8 +1156,8 @@ model Expense {
11551156 ))
11561157 @@allow("update" , hasBeenSentToBookkeeping == false && (
11571158 (memberId == auth().memberId)
1158- || items?[signerMemberId == auth().memberId]
1159- || has(auth().policies, "expenses:bookkeeping" )
1159+ || items?[signerMemberId == auth().memberId]
1160+ || has(auth().policies, "expenses:bookkeeping" )
11601161 ))
11611162 @@allow("delete" , false )
11621163
@@ -1183,7 +1184,7 @@ model ExpenseItem {
11831184 @@allow("create" , has(auth().policies, "expenses:create" ) /* && signerMemberId != expense.memberId (TODO: Uncomment this when we upgrade to zenstack v2) */ && signedByMemberId == null && signedAt == null )
11841185 // copy auth from Expense
11851186 @@allow("read" , (
1186- expense.memberId == auth().memberId
1187+ expense.memberId == auth().memberId
11871188 || expense.items?[signerMemberId == auth().memberId]
11881189 || has(auth().policies, "expenses:bookkeeping" )
11891190 ))
0 commit comments