Check for admin roles


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. global $user;
  3. $adminRoles= array('dev','editor','employee');
  4. $check = array_intersect($adminRoles, array_values($user->roles));
  5. $adminAble = empty($check) ? FALSE : TRUE;
  6.  
  7. if($adminAble) {
  8. print '<p>SHOW THE SPECIAL INFO</p>';
  9. }
  10. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.