Powers of 2

Sooo
1,2,4,8,16,32,64,128,256,512,1024 allll the way up to 2^32

So you can have 32 access levels....which is more than enough for most apps
(actually find 3 levels is enough). Word of warning, be wary of where you
store the usersecurity info a user only has to store 2^33-1 to get access to
all security levels. Where I have to have cookies, I do a check before the
display/updating of sensitive information. Otherwise I let them do what they
want.

> ----------
> From:         Stephen Fernandez[SMTP:[EMAIL PROTECTED]]
> Sent:         09 October 2000 12:12
> To:   Fusebox
> Subject:      RE: Security issues
> 
> thanks adam, that looks pretty cool, i guess also as its using bit
> functions
> this code should be faster than the other methods suggested? 
> 
> are the values 1,2 and 4 significant? or can they be any values?
> 
> -----Original Message-----
> From: Reynolds, Adam [mailto:[EMAIL PROTECTED]]
> Sent: 09 October 2000 11:46
> To: Fusebox
> Subject: RE: Security issues
> 
> 
> Roughly...
> <cfscript>
>       request.useradmin = 1;
>       request.reportadmin = 2;
>       request.siteadmin = 4;
> </cfscript>
> 
> Somewhere in your login in code ....
>       request.userpermissions = request.useradmin + request.siteadmin
> 
> Somewhere in your function listing areas
> 
>       <cfif bitand(request.userpermissions,request.useradmin)>
>               display your user administration functions here.
>       </cfif>
>       <cfif bitand(request.userpermissions, request.reportadmin)>
>               display your report admin functions
>       </cfif>
>       etc...
> 
> User shouls see Useradmin and Siteadmin functions.
> --------------------------------------------------------------------------
> ----
> 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.
> 
**********************************************************************
 This email and any attachments are confidential and solely
 for the use of the intended recipient.  They may contain
 material protected by legal professional or other privilege.
 If you are not the intended recipient or the person responsible
 for delivering to the intended recipient, you are not authorised
 to and must not disclose, copy, distribute or retain this email
 or its attachments.  Although this email and its attachments
 are believed to be free of any virus or other defect, it is the
 responsibility of the recipient to ensure that they are virus free
 and no responsibility is accepted by the company for any
 loss or damage arising from receipt or use thereof.

**********************************************************************
------------------------------------------------------------------------------
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.

Reply via email to