Open deontologician opened 8 years ago
3 for me.
sharing my use case - I'm trying to build a multi-tenant content management system, and want to make 'collections' of documents that can be edited only by some users. I store metadata regarding my collections in a table called 'collections', which contains which users are allowed to edit which docs. So I'd like to allow writes/reads to a collection(/table) only if the user is in a field in a corresponding field in the 'collections' table.
So 2 things prevent me from doing this in horizon right now -
I'm ok with validation being asynchronous/a black box. As an example implementation detail, the validator function could take an optional done
callback, to be called by the validator when it's finished.
Looking forward to a solution for this too.
My use case is very similar to @threepointone's. The schema is pretty complex and has different layers of access.
There have been a couple of mentions about how the validators are a bit limited at the moment since you can only look at the document and the context. There are a couple ways I can think of to modify this:
ref
types (see rethinkdb/rethinkdb#4853). This would keep everything mostly the same on the Horizon end, but users could get data from other tables in the document itself. (They'd have to add out-references though, so this may still put some restrictions on how the users design their data scheme)