Hi! Is it possible to add some kind of custom attr...
# orm-help
d
Hi! Is it possible to add some kind of custom attribute to Prisma schema fields. I want to build a declarative security layer and define which permissions are required to read/write a certain field. Kinda like:
Copy code
email      String?     @privilege("owner")
Or do I have to use comments for that?
r
That isn’t possible at the moment. It would be great if you could create a feature request so that we can look into this. Privileges would need to be handled on the application side at the moment.
d
@Ryan feature request for privileges or for custom annotations? 🙂
r
I would say creating one just for privileges should be fine where you could share the example above 🙂
d
I’ve handled it via field comments like this for now, so maybe custom annotations are not really all that necessary for now… https://github.com/paljs/prisma-tools/pull/235
👍 1
Regarding privileges, it’s a huge topic, I don’t really have the time to dump all my thoughts at the moment unfortunately, though I do have something to say… Maybe I’ll find the time next week
💯 1
r
Sure 🙂