Checkout this link:

How to check whether the user is an administrator