Hi all,

I have a need to use a kind of user permission system in the database,
but because the database is a hosted solution, I do not have access to
the real user tables and permissions and such.

SO...

What we're talking about is a document management system:

1.  Some users can read, write, and add documents
2.  Some users can only read documents
3.  Some users cannot do any of the above

I need to implement some kind of table that allows these things.

CREATE TABLE MemberPermissions (
  MemberID bigint NOT NULL auto_increment,
  canRead tinyint NOT NULL default 0,
  canWrite tinyint NOT NULL default 0,
  canInsert tinyint NOT NULL default 0,
  PRIMARY KEY  (MemberID)
) TYPE=MyISAM;                         

where the canRead, canWrite, and canInsert are Boolean flags of 0 or 1.

Clearly, I will need to implement a login system.  With this design, it
appears that there will either need to be two queries - one to check the
permissions, and the second to perform the action requested.  I suppose
the other thing I could do is query the permissions on login and cache
that info in session data while the user is logged in.

I had another thought to assign permissions to groups, and then assign a
group to a user.  Would this be easier and more manageable?

I am looking for feedback as to whether this is an appropriate design,
or perhaps some suggestions for a better design, pitfalls to watch out
for, etc.

Best regards,

-Erich-



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to