User-Level security example, please review

AUGuy

Newly Registered Idiot
Local time
Today, 13:11
Joined
Jul 20, 2010
Messages
135
HK1 kind of beat me to the punch of uploading something similar, but this is something i've been working on for a week or so now when I have free time at work.

In a nutshell, I was developing a solution to having user-level security without using the one integrated within Access. After some idea browsing and picking neat ideas from one place or another, I drew up an idea and began trying it out. I wanted to avoid Logins, but have it go off of the User's corporate network identity. As this allows for lots of things down the road that I can use this for.

What I've come up with is a proof of concept that takes this network ID, compares it to a permission table, and auto-adjusts the layout of a single form to show a clean button layout that can be used by multiple users simultaneously.

Some things I need help with:
I'd like to explore different ways to add new forms/menus to the list of available options. As it stands, I have to go into the code, replicate lots of stuff manually, and then add an additional label into the form, set it to work with everything, etc... Is there a better, admin-friendly, way to do this?

Things you should know:
This was first and foremost a "I wonder if I can do this" project. It has worked suprisingly well so much that management has encouraged me to continue developing it. You may notice ways I've done things that make your skin crawl. Please let me know if I've taken unnecessary steps to get from point A to B, as I'm self-teaching myself this stuff. The state of the database represents my knowledge of design, theory, and implementation as of right now--I'm always willing to learn more!

Things I'm aware of:
There may be issues with validation rules that pop up.
There isn't much here as far as adding users, etc, available right now. This is something that I can easily add, but I want to first finalize the moving parts and have them as efficient as possible before I make that next step.

Tables:
tbl_AccessLvl: Preset access Levels, these will eventually be used to give users blanket priveleges, which can be customized.
tbl_AuthUserList: Contains the list of authorized users. For me, my username is "c40368". The beauty of this is that for our purposes it is highly unlikely that one user could have access to another user's menu options as this is tied to their Windows login which has great corporate security measures taken to keep it secure.
tbl_DeptList: Lists all departments who a user may belong to within the corporation. Not really used now other than cosmetics, but will be used later for change tracking.
tbl_MenuPerm: Menu Permissions, 1 designates allowed access, while 0 is not allowed. Change these as you are moved to do so and see how the menu will adjust its layout. (I thought this was neat)

Forms:
frm_TestInfo: Info Form for testing
frm_Form1-5: Simply placeholder forms that will eventually hold menu contents.
frm_Splash: Opens on DB open and displays user info, etc. This will eventually be modified to contain messages from the admin, MoTD, etc... Opens the UserMenu
frm_UserMenu: The heart of the operation... Automatic layout pretty-ifying (yes its not a word!). Essentially a portal to the user's allowed access points.
 

Attachments

A pretty good start but for an example, you should

1. not hide the tables that are important like that so that the users here can see what to add for the userID's. It took me a bit to figure out that there was more than one place that my login ID had to be entered for things to work properly.

2. Having this in the code:
Code:
    strUserID = Environ("username") 'This is normally not commented out, but is to allow ease of testing
'    strUserID = "c12345" 'this is a temporary variable value to allow testing, line to be removed before going live
is fine but you might put a few lines of spaces in between that code and the rest. It is pretty hard to read with so many lines bunched together and so it is easy to miss the note about changing it.
 
Thanks for the input, Bob. I'll take note for the next example I post : )
 

Users who are viewing this thread

Back
Top Bottom