2008
Nov
06

This way you can print blocks, menus, links, etc. based on role:

<?php global $user;
if (in_array('rolename', $user->roles)) : ?>
<p>print stuff here</p>
<?php endif ?>
  • Joe L
    So for example:
    if (in_array('admin', $user->roles)) : ?>
    do stuff for admin
blog comments powered by Disqus


All rights reserved. © Copyright 2008 MikkoLehtinen.com