Web design, programming, graphics, and pretty much anything else I care about.

Show block only for specific user or role

A quick and dirty way to control the visibility of a block is to add a php snippet. Set the visibility in the block administration to "Show if the following PHP code returns TRUE", and use something like this:

<?php
global $user;
if (
in_array('authenticated user', $user->roles)) {
  return
TRUE;
} else {
  return
FALSE;
}
?>

I know what you're thinking. There is a setting for making a block visible by role. Yes, but there is no setting for making a block NOT appear for a role. Take the same code and return FALSE for a specific role, or return TRUE for a specific user, etc.