Reputation: 416
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.
Upvotes: 1
Views: 753
Reputation: 9384
(Untested)
global $user;
<?php if (!in_array('anonymous', array_values($user->roles)) && $show_messages && $messages): ?>
<?php print $messages; ?>
<?php endif; ?>
Upvotes: 2