On 9 Oct 00, at 10:09, Reynolds, Adam wrote:
> You can simplify this even further by using the BitAnd function. This
> operates on a 32 bit integer. Give different facilities a unique binary
> number (1 2 4 8 16 32 64 etc...)
This has been my preferred method of managing roles and authorizations for
years, regardless of language. By using well-named constants to represent the
values for each security level, you make your code very easy to interpret.
Here's the next step I use for byte-code user customization: create a table
that holds menu entries. Each record contains a menu item's label, action,
etc., and a byte code that reflects which user roles (or security levels) have
access to that menu item. Now you can use a query against the table to
dynamically generate menus depending on what authorizations the user has.
What's more, adding or removing capabilities from a role becomes a simple
matter of changing the bytecode value in the table, rather than editing a bunch
of code.
- Jeff
==============================================================
| Jeffrey S. Peters | "Specialization is for insects." |
| [EMAIL PROTECTED] | - Lazarus Long |
==============================================================
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.