Personally I think bit-logic as a means of determining permissions for
application features is over-complicated, difficult to implement and/or
modify and seriously limits your options.

But then, that's not my decision to make. :)

My tendancy with roles and permissions is to use cross-reference tables
which join a given role or user to a given permission. The upshot is that
it's easy to implement, update, maintain and modify later, and eliminates
any artificial ceiling to the number of features ( or alternately roles )
you can implement with security in your app. The downshot is that it
requires slightly more storage, memory, etc. however, I think the benefit ot
not constantly having to figure out if you have bit functions available to
you in a given location, or what bit specifically represents a given role or
permission, is well worth the small amount of extra overhead for the server.


S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

> ok....9223372036854775806.5
> is what I come up with, and that's fits, but kinda
> makes our logic a bit kludgy....

> what we want to do is from a query, get that
> number, binary it, use the binary places as on/off switches
> for feature access, and then bitAnd() the re-done binary
> string against the full features number, to determine permissions....

> so, not having to do that calc would have been cool, but rather
> than plan for 64 possible features, we might just assume 32 of them, and
> go from there.
> since the decimal value of a 32 bit binary string fits fine in the
> bigint datatype...

> whatcha think?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to