Quantcast
Channel: How To – Paul K Leasure
Viewing all articles
Browse latest Browse all 39

Drupal Role Specific Development Feedback

$
0
0

On rare occasions you may have to work on a production site and need some development feedback.
If you want to control which role sees your output, this snippet can help.

With this logic in place, only appropriate roles will see your working on the site.

<?php
// This is to get whatever is in the if statement to show ONLY for the appropriate user role.
global $user;
$check = array_intersect(array('moderator', 'administrator'), array_values($user->roles));

if (empty($check) ? FALSE : TRUE) {
    // is admin
    echo "Only visable to moderator or administrator.<br />";
}
?>


Viewing all articles
Browse latest Browse all 39

Trending Articles