I am storing additional attributes in my '_users' db records. In the case where I have multiple users sharing a database, where one is the owner and one is the reader/writer, I would like to get that user's db property to see what database they have permissions to write to.

Is it possible to modify the response of POST _session or GET _session to respond with the cookie, but also with the db property from a '_users' record in the response body? Thanks in advance.

有帮助吗?

解决方案

No, that is not possible at this time. This idea has been proposed, but not implemented a few reasons. (it's a long thread, but I felt it was relevant)

It sounds like you may want to take advantage of the database security object. This configuration allows you to set up specific users or roles with read/write capabilities per-database. (plus, this object will be sent to validation function, and it allows custom fields in addition to the mandatory ones)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top