a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

await permissions

+3 -3
+3 -3
src/replicache/serverMutationContext.ts
··· 84 84 .select({ entity_set: entities.set }) 85 85 .from(entities) 86 86 .where(driz.eq(entities.id, f.entity)); 87 - if (!this.checkPermission(f.entity)) return; 87 + if (!(await this.checkPermission(f.entity))) return; 88 88 if (attribute.cardinality === "one") { 89 89 let existingFact = await tx 90 90 .select({ id: facts.id, data: facts.data }) ··· 140 140 .from(facts) 141 141 .rightJoin(entities, driz.eq(entities.id, facts.entity)) 142 142 .where(driz.eq(facts.id, id)); 143 - if (!f || !this.checkPermission(f.entities.id)) return; 143 + if (!f || !(await this.checkPermission(f.entities.id))) return; 144 144 await tx.delete(facts).where(driz.eq(facts.id, id)); 145 145 }, 146 146 async deleteEntity(entity) { 147 - if (!this.checkPermission(entity)) return; 147 + if (!(await this.checkPermission(entity))) return; 148 148 await Promise.all([ 149 149 tx.delete(entities).where(driz.eq(entities.id, entity)), 150 150 tx