Hide custom field from certain group

Is there a way to hide a custom field I created on product from certain group of users? I don’t want some users the field on list view nor on record page view.

Hello :slight_smile:

you can manage this using permissions :

try for example with : $user->hasRight(‘produit’,‘creer’) ? 1 : 5

Good continuation

2 Likes

Thanks @pcbleu

i defined a cutom field on user “canseecustomer”

then i use this on the field I want to hide based on user access
($user->array_options [‘options_canseecustomer’] = 1)? 1 : 0

not seem to be working, am I using the correct formula?

sorry I think i figured it out, formula should be with ‘==’ instead of ‘=’

($user->array_options [‘options_canseecustomer’] == 1)? 1 : 0

WOOOW, I love that, never thought of that option

1 Like