Back

Client only way to limit the number of resources a user can create

  • 1
  • Databases
  • Web
  • Cloud
Neo
20 Dec, 2023, 08:04

Hi, did anyone figure out a creative way to limit the amount of resources (collection documents) a user can create?

I am trying to avoid proxying document creation through functions that are called from a client if possible. If there’s no other way sure.

TL;DR
The user is asking for a way to limit the number of resources a user can create without using functions. One suggestion is to maintain a count in the user's profile collection and restrict document creation once it reaches a threshold. Other users suggest using functions as the best option. No solution is provided in the thread.
punti_z
20 Dec, 2023, 11:12

How many documents do you want the users to be able to create ? A hacky way would be to maintain the number user has in users profile collection n restrict user from creating documents if it reaches the threshold till user deletes some.

Guille
20 Dec, 2023, 12:02

I think function will be the best option, why would you want to avoid a function?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more