Show a field style only to certain people

LearnUseThrive
Mega Sage

I granted a read permission on a certain field only to certain admin users and denied it to everyone else. The field can't be accessed by them, however when I use javascript in field style to set a decoration on a field, everyone can see the style. Is this because it's running the javascript server side and not checking user's permissions? How to resolve?

 

javascript:current.u_breach_stage==1

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@LearnUseThrive Could you please try the following and see if it works.

 

 

javascript&colon; current.<field_name>.canRead()&&current.u_breach_stage==1

//Here replace <field_name> with the name of the field where the read permission needs to be checked.

 

In the above script replace <field_name> with the name of the field where the read permission needs to be checked.

 

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@LearnUseThrive Could you please try the following and see if it works.

 

 

javascript&colon; current.<field_name>.canRead()&&current.u_breach_stage==1

//Here replace <field_name> with the name of the field where the read permission needs to be checked.

 

In the above script replace <field_name> with the name of the field where the read permission needs to be checked.

 

It worked. Thanks!