#Mask the value of the field for the non-admin user but make the field visible.

15 messages · Page 1 of 1 (latest)

broken pilot
#

Currently, I have enabled the hidden on detail for the field, but it hides the field on detail for admin role also. So, can I make the make the option enable only for non-admin role or be a role specific ?

lucid sableBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

primal iris
#

Out of the box I would say not. But what could work is, if you save the "secret" in a 2nd collection, which is restricted to the admin role. afterwards adding the "secret" item to the original item from the base collection should do the trick, but a bit oversized and a custom interface like a "secret field" would be much handier

broken pilot
#

I am a not experienced in this, how would I save the secret in the 2nd collection ? I have multiple rows of data read from postgres database.

primal iris
#

Oh I was thinking of just one value, so a simple collection with and ID/GUID and a value like this:

#

and the "main" collection would look like this:

#

if the collection "my secrets" is restricted to admins, regular users should not be able to access the values, but I'm not sure if they will purge the value of the relation field, once the update other fields, this has to be tested 😄

#

also this structure might not be that secure as expected and may has a way to read the value somehow, just an idea to consider, depending on the value you try to mask, it could work (or not) e.g. I would not store user passwords etc. like this

broken pilot
#

Yeah , thank you very much
I think this will not be way I would wanted to go.
Is there an programmetically possible to know who the user is and if they are non-admin, then just intercepts the response and mask the field and pass to the UI ?

primal iris
#

using this you can define the exact behaviour of the field e.g. "mask on non-admin"

#

this has the example for "to lowercase" you have to extend this, to fit your needs

open parrot
#

Careful with using a custom display tho, as this will only mask it in the View.The API request will still contain the non masked field if you don't set up the permissions correctly.

dusky quail