Drupal 7 show / hide field for role

Is there a module to display / hide fields for a specific role in Drupal 7 ?

I know the Permission Field , but this is not quite what I need.

I have two fields:
picture
picture_premium

and these roles:
anonymous
authenticity premium

the image field must be visible to: anonymous and authenticated
the picture_premium shoudl field will be visible to: premium

Please note that the premium must not see the image field.

+6
source share
2 answers

You must use the Field Permissions Module .

It was created just for this.

Hope this helps ... Muhammad.

+10
source

To expand this bit - in the described scenario, the permissions to use the fields will not work, since all premium users will also be authenticated. The only way to use usage permissions for this is to assign a separate role, for example, "regular" for all users who have not been authenticated before. Then you can make the image field visible anonymous and normal, and picture_premium premium. A.

I don't know yet if there is a better solution.

+2
source

Source: https://habr.com/ru/post/924694/


All Articles