title: User permissions as bits in an integer
body: <p>Let's say I'm storing an integer for each user in a database that represents their assigned permissions. The number stored is the sum of the powers of two associated with each permission assigned.</p>
  
  <p>What's the easiest way to check to see if a certain permission was granted (within VBScript/ASP, or generally)?  The best idea I have is to convert the integer to a binary string and check the bit I want, but I sense there is a better solution (and I feel guilty for not realizing it yet.)</p>