MCPcopy Index your code
hub / github.com/tldraw/tldraw / assertUserCanUpdateFile

Function assertUserCanUpdateFile

packages/dotcom-shared/src/mutators.ts:207–209  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

205 * Note: Sharing only grants read access, not write access
206 */
207async function assertUserCanUpdateFile(tx: Transaction<TlaSchema>, userId: string, file: TlaFile) {
208 await assertUserCanAccessFileInternal(tx, userId, file, false)
209}
210
211export function createMutators(userId: string) {
212 const mutators = {

Callers 1

createMutatorsFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…