C
Craig Buchanan
I am using flag as the identifier for various security settings. For
instance:
Public Enum SecurityEnum
Read=0
Write=1
Delete=2
...
End Enum
I have a few questions:
1). If I want to group a number of these rights into a role, should I
determine the xor result of all the rights that i need? or always xor the
rights?
2). What type of database field should i use for storage? Byte? What
size field?
3). Is there an easy way to determine the value of all bits being turned
on?
4). Does it matter if i define the values in the enum using 1,2,4 or
&h1,&h2,&h4?
5). What is the right 'numbering' for each successive bit? Powers of 2,
correct? In hex, would that be &h0,&h1,&h2,&h4,&h8,&h16...?
6). Can someone suggest a primer on using flags?
Thanks in advance,
Craig Buchanan
instance:
Public Enum SecurityEnum
Read=0
Write=1
Delete=2
...
End Enum
I have a few questions:
1). If I want to group a number of these rights into a role, should I
determine the xor result of all the rights that i need? or always xor the
rights?
2). What type of database field should i use for storage? Byte? What
size field?
3). Is there an easy way to determine the value of all bits being turned
on?
4). Does it matter if i define the values in the enum using 1,2,4 or
&h1,&h2,&h4?
5). What is the right 'numbering' for each successive bit? Powers of 2,
correct? In hex, would that be &h0,&h1,&h2,&h4,&h8,&h16...?
6). Can someone suggest a primer on using flags?
Thanks in advance,
Craig Buchanan