March 11, 2003 at 12:24 pm
I am creating a document viewing system. Each document will have some combination of read/write/delete privileges and will be stored in a document table. I am creating two tables (users,groups) that have access to the documents (least restrictive privilege shall be used). How should I store the privilege value for the user/group - as an integer value (0-7), as three different bit fields, or some other strategy. Thanks!
March 14, 2003 at 8:00 am
This was removed by the editor as SPAM
March 15, 2003 at 5:41 am
I think it depends on your comfort level (and any users querying directly) applying bitmap logic. Typically I'll go with individual bit cols. When you allocate a bit column internally SQL sets aside a byte, so you can use 8 bit's for the price of one. If you think you'll end up extending your permission scheme then you'd have to add columns, where with the int value you'd just do more masking.
Andy
March 16, 2003 at 10:24 am
I'd use three bit fields, or a separate many-tom-many relationship table. With a single column storing a bitmasked value you won't be able to have foreign keys.
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply