
how to perform acton to collectons which React Native SDK user having no permission.
actually, I can give them permissons but considering it would be redudancy and wastes of resources as well as performances. I decided for nextjs (node-apwrite), I only give permission document level to Clients collection. By doing that, other collections which are considered using clients collection as FK, will be based on to verify the permissions.
Based on code below, I can do that fine on NextJS server action, but I would like to do the same for react native but I also understand RN is client framework. so what is the workaround for this
export async function queryHealthRecords(clientId: string): Promise<ActionResult<HealthRecords>> {
// check if user can access by finding specific document of Clients collection to see its permission against logged in user
const hasPermission = await hasPermissionByClient(clientId)
if (!hasPermission) return []
const db = await createAdminDB()
const models = await db.healthRecords.list([Query.equal("clientId", clientId), Query.limit(maxQueryLimit), Query.orderDesc("recordDate")])
return await Promise.all(models.documents.map(async (model: any) => await mapToHealthRecordDto(model)))
}
Recommended threads
- 1.6.2 to 1.7.2 upgrade, no console acces...
I just updated from 1.6.2.to 1.7.2, didn't notice any errors in the update or migration process but seem to be stuck not being able to access the console UI any...
- Self Hosting Error Cannot Create Default...
Just installed appwrite and upon doing an initial sign up for the default user it errors out with ```NetworkError when attempting to fetch resource.```
- Changing Default Port (appwrite:1.7.2)
Hello! I am trying to run appwrite locally to test things out and i wanted to change the default ports. I have seen this post https://discord.com/channels/56416...
