bitwise rights system


i'm making bitwise rights system users.
the method this:
right 1 has 2^0 = 1
right 2 has 2^1 = 2
right 3 has 2^2 = 4
right 4 has 2^3 = 8
right 5 has 2^4 = 16
right 6 has 2^5 = 32

so, when place in 6 checkboxes , checked rights 1, 3 , 6. has give me summation of rights have checked 37. done , works.

but problem, if try edit rights user, how can calculate value 37 rights 1, 3 , 6 checked , rights 2, 4 , 5 not checked? has dynamic, because use mysql database store values each user.
if user has value 6, has calculate rights 2 , 3 checked in 6 checkboxes.

someone can me?



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial