Skip to content
Back

Simple permissions question.

  • 2
  • Databases
  • General
v
25 May, 2024, 14:25

If I have a relation with multiple users, how can I ensure that only those users have the necessary permissions? Additionally, how can I update permissions automatically when a user is removed from the relation?

To paint a picture, something similar could be achieved within pocketbase permissions by adding a rule that looks something like "some_table.related_users.id ?= @request.auth.id". I don't expect it to be quite as easy, just looking for an efficient clean solution.

TL;DR
Developers are discussing user permissions and how to ensure only specific users have necessary access. The solution suggested is maintaining a table for permissions, implementing checks based on this table, and using database triggers to automate updates. This approach ensures permissions are accurate and updated when users are removed. Additionally, they are exploring ways to achieve similar functionalities as seen in Pocketbase permissions for efficient and clean solutions.
Preetam_vrl
25 May, 2024, 14:33

By maintaining a user permissions relation table and implementing permission checks based on this table, you can ensure that only specified users have the necessary permissions. Automating updates to this table using database triggers or application-level hooks ensures that permissions are kept up to date when users are removed

v
25 May, 2024, 14:42

I believe the 'users permission relation table' isn't applicable for me however by 'database triggers' I assume you mean events and functions? That wouldn't be too bad. I'll see if I can find any code examples for events and functions.

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