Using Data in permissions #7038
Replies: 2 comments 2 replies
-
@andrewalex can you share the schema of the |
Beta Was this translation helpful? Give feedback.
-
The tables here were just an example, the real thing is more complicated to explain, but here is a schema that I think represents the challenge. If you can use _exists, that would be awesome https://dbfiddle.uk/?rdbms=postgres_13&fiddle=2362f232e8284e94b93e5946a92a0fa3
Essentially only the manager of this specific store can insert into inventory (Role is not suitable for this, but its easy to do), and can only insert books listed in allowed_books .. something like WHERE bookid in (SELECT bookid from allowed_books where storeid= $storeid) The same filtering could be useful for selects as well. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
when setting a permission, can I refer back to a field in the initial record or insert data?
Pseudo Code
Beta Was this translation helpful? Give feedback.
All reactions