views:

321

answers:

1

Is it possible to suppress the status messages set by drupal_set_messages() for certain roles? One client does not want certain roles (anonymous) to see these messages.

+2  A: 

(Untested)

global $user;

  <?php if (!in_array('anonymous', array_values($user->roles)) && $show_messages && $messages): ?> 
      <?php print $messages; ?>          
  <?php endif; ?>
Niels
That should do it - thanks!
BrianV