* Check if a user can update (write to) a file. * A user can update a file if: * - They own it (legacy model: file.ownerId matches userId) * - They are a member of the owning workspace (new model: user is in file.owningGroupId) * Note: Sharing only grants read access, not write access
(tx: Transaction<TlaSchema>, userId: string, file: TlaFile)
| 205 | * Note: Sharing only grants read access, not write access |
| 206 | */ |
| 207 | async function assertUserCanUpdateFile(tx: Transaction<TlaSchema>, userId: string, file: TlaFile) { |
| 208 | await assertUserCanAccessFileInternal(tx, userId, file, false) |
| 209 | } |
| 210 | |
| 211 | export function createMutators(userId: string) { |
| 212 | const mutators = { |
no test coverage detected
searching dependent graphs…