Show some text only to users who don't have a particular role

Over the past few weeks I've been working away on the Nevada Boys' State website. It is a pretty cool site if I do say so myself. The delegates log in and complete things like the pre-program survey and submit legislation. Of course it is a Drupal site. Using Taxonomy Access Control pages are created for parents, staff or delegates. However parents and staff can look at the delegate pages. This is fine but there is some customization done on the page that shows the current user's email and reports that it's the "Delegate's email account".

It is a simple problem to solve and a quick trip to the Drupal site gave me the pieces to put together the following code that shows a note for anyone who logs in and views a Delegate page but doesn't have the role of Delegate. (Delegate has been changed in this code to MyRole).

Category: