Support for row-level security (RLS)
## Problem <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> Currently, if we want to guarantee that user's requests have enough permissions to run a query, we have to keep coding `where:{...} ` clauses everywhere in our code. Depending on the size of the code base, it can be extremely hard to make sure that all query conditions are correct, updated and concise with the data model. ```ts // check if the venue is the actual owner of the ticket if (id) { const ticket = await prisma.ticket.findFirst({ where: { id, venueId: context.venue.id, }, }) if (!ticket) { throw new Error('Ticket not found') } } // there's no way to verify to make sure the upsert has enough permission to update or create await prisma.ticket.upsert({ where: { id, }, update: data, create: { ...data, venueId: context.venue.id, }, }) ``` ## Suggested solution We could have a way to implement some sort of `@@security` directly on the `schema.prisma` file. This way, we can check the user's permissions directly on the database, saving some back-and-forth queries and also making sure that rules will always be respected anywhere in the codebase. An API that follows the same `where` principles applied to the models will allow a more flexible and powerful way to implement a granular security. ```prisma @@security( name: 'Blah', // Name of the rule (impo
Posted by wladpaiva on Apr 8, 2022, 1:08 PM
Tags
Related issues
- To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
- > The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
- Custom trigger IDs are not displayed in the new 2026.10 trigger selector
- I hate that too, but I think it’s more the ux than the concept of a default.
- > The biggest problem with UX developers is they know better than you AND force you into their paradigm.
- "Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
ux (Other)
To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
New> The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
Custom trigger IDs are not displayed in the new 2026.10 trigger selector
I hate that too, but I think it’s more the ux than the concept of a default.
> The biggest problem with UX developers is they know better than you AND force you into their paradigm.
"Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
The biggest problem with this is if the target URL doesn't load but also doesn't quickly error out, like e.g.
Google wants to build up a private web here.
Support for row-level security (RLS)
## Problem <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> Currently, if we want to guarantee that user's requests have enough permissions to run a query, we have to keep coding `where:{...} ` clauses everywhere in our code. Depending on the size of the code base, it can be extremely hard to make sure that all query conditions are correct, updated and concise with the data model. ```ts // check if the venue is the actual owner of the ticket if (id) { const ticket = await prisma.ticket.findFirst({ where: { id, venueId: context.venue.id, }, }) if (!ticket) { throw new Error('Ticket not found') } } // there's no way to verify to make sure the upsert has enough permission to update or create await prisma.ticket.upsert({ where: { id, }, update: data, create: { ...data, venueId: context.venue.id, }, }) ``` ## Suggested solution We could have a way to implement some sort of `@@security` directly on the `schema.prisma` file. This way, we can check the user's permissions directly on the database, saving some back-and-forth queries and also making sure that rules will always be respected anywhere in the codebase. An API that follows the same `where` principles applied to the models will allow a more flexible and powerful way to implement a granular security. ```prisma @@security( name: 'Blah', // Name of the rule (impo
Comments (0)
No comments yet. Start the discussion.