Access field permissions programmatically when printing fields in node.tpl.php

Created on 24 February 2014, almost 11 years ago
Updated 17 July 2023, over 1 year ago

If you print a separate field in your node.tpl.php, you need to be aware of the field permissions. You can access them by calling user_access(). So to check if the current user has access to view field_factsheet you call user_access('view field_factsheet');

Took me a while to figure it out, so maybe useful for the documentation.

πŸ“Œ Task
Status

Fixed

Component

Documentation

Created by

πŸ‡³πŸ‡±Netherlands HansKuiters

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024