Am planning to make a database design where I store the permission, my user has in terms of bits.
Say, my user table has the column username VARCHAR(100), permbits BIT VARYING(64)
my permission table has the columns permname VARCHAR(100), permbits BIT VARYING(64)
Example rows in my user table would be
('Joe', 1001) ,
('Ram', 001)
Example rows in my perm table would be
('View Record', 0001),
('Delete Record', 0010),
('Create Record', 0100),
('Edit Record', 1000)
So Joe would have edit and view Record permission
and Ram would have view Record permission alone
My Questions are
1) What is the maximum number of permissions that can be created?
2) How do I move on with the bit manipulation (i.e. expanding user's permission and mapping to corresponding permission in permission table).
3) Is this design fine? Can anyone suggest better alternatives?
Appreciate your advices for this question.