#Hiding Values in Scaffold View

1 messages · Page 1 of 1 (latest)

tender tendon
#

Working with Redwoodjs and created a bunch of scaffolding for users and groups of users. Unfortunately, the way I have some of the authentication and RBAC controls stored in the DB, they are showing up in the scaffolding view. I don't mind them being in the edit pages as those are auth/RBAC protected and you can only see the one you're working on, but is there a way to mask those values by some kind of definition in the schema.prisma file, so that in the general scaffold view you can't see everyone's information at a glance?

noble fiber
#

Hmm. Honestly, I think the easiest way is to simply edit the scaffolded file and remove those fields from showing.

#

I haven’t looked in a while so can’t remember exactly what they look like. But that’s the approach I would take

fierce crystal
#

Maybe validate directives?

noble fiber
fierce crystal
noble fiber
gentle oxide
#

First, re: " have some of the authentication and RBAC controls stored in the DB, they are showing up in the scaffolding view". Consider adding these permission fiends to a differnt model other than User, like Profile or Permission. That way you can access thr valies via Prisma, but if you don't add the profile to sdl types or expose via graphql, it won't be available to web. It grealty helps reduce thr risk that those value could leak.

#

You can mask via a directive, but honestly, i'd move them to a new model.

#

Also by moving ti a new model, you cna can much more fine grained control over who can add or edit that info.

gentle oxide