User Management

navbor

New member
Joined
Apr 14, 2009
Messages
3
Programming Experience
Beginner
Hi All,

I am writing a small windows based app using VB.NET and MySQL. I was wondering what the best way would be to manage users and their access to the application.

I intend setting up a class for UserGroups and an inherited class for Users. Each user will then have different access levels to the application that may or may not differ slightly from the parent "UserGroups".

The acess control will be to control the acess to the application features itself, not so much the database. For this I will set up the "user" table in the "mysql" database.

Does anyone have any suggestions as to whether this would be a correct approach, or are there any other suggestions (or even already defined classes for managining this kind of data).

Of couse I will also have a "user" table in my own database in MySql where I will store all the various settings for each user's access to the application.

Any comments / suggestions welcome.
Thanks
Rob
 
It's how I've done it in the past:

There's an 'ALL' group, the group the user belongs to, and the user. Flags per particular action dictate what they can and cannot do (rather than levels) and the results are pulled something like:

SELECT permission FROM Users WHERE (username = :user OR group = :group OR group = 'ALL') and action = :action
ORDER BY
CASE WHEN username = :user THEN 1 WHEN group = :group THEN 2 ELSE 3 END

Take the top row only; it's the most specific permission for a given action
 
Back
Top