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.
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
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.
Recommended threads
- what happened with 'never paused' ????
I can already imagine how annoying this is going to be...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...