[AccessD] Light Weight Security system and demo

jwcolby jwcolby at colbyconsulting.com
Fri Mar 7 17:30:03 CST 2008


I have a fully functioning LightWeight Security system and demo of how to
use it.  If anyone is interested in using it please contact me offline.  I
will be putting it up on my web site soon and probably on the
www.DatabaseAdvisors.com as well, though that requires some assistance from
Jim to get it up there.

The idea is as follows.  Understand that while the concepts are a little
complex, the usage is about as dead simple as I can make it, which is pretty
simple.

There are 4 tables used to hold LWS (LightWeight Security) information to
allow the security system to function.  The tables are:

Users
Groups
GroupUsers
SysVars

Users holds just enough information to allow a user to be found and logged
in.
Groups are functional areas of the database that users can access.
GroupUsers are users in a group
SysVars are control data for controlling the operation of the database.

The concept works very similar to Windows.  Before you can open a database
you have to log in.  Once you log in you belong to groups.  The designer of
the database will use a function that says whether a user belongs to a group
to enable security for forms and controls.  

For example a form Open can be canceled if the user does not belong to a
group that is allowed to open that form.  A tab control on a form could have
the visible property of tabs set to false, and when the form loads, the code
can make those tabs visible if the user belongs to the required groups.
Combos, text boxes, command buttons and other controls can be made visible
if you belong to a group that allows you to see that control.  Form
properties such as AllowDeletes, AllowAdds AlowEdits etc can be enabled if
you belong to a group that is allowed to perform those actions.

To use the LWS library (C2DbLWS), it is referenced just like any other
library.  The library contains all of the code, forms and tables required to
work.  You have to import the four tables into your BE, then link them to
your FE.  Set a reference and begin using the system.  Once you import the
tables, you can open forms out in the library which will display the data in
these four tables in your FE (linked to the BE), and allow you to edit that
data.  You will set up your own users, groups, and then set what users are
in what groups.  Once you have done that the LWS system "caches" all of the
data in classes in collections.  The LWS framework provides wrapper
functions that allow you to determine whether a user is in a group or set of
groups.

Your job is to set up security on a form, setting the visible and other
properties of controls and forms to allow them to function as you wish for
the groups you wish.

I have a functioning DEMO "FE" that is linked to the library.  This demo has
a switchboard that displays who is logged in, what groups the logged in user
belongs to, and has buttons on the switchboard to login (as a different user
whenever you need to) and also to edit the LWS information (but only if you
are an administrator).  

This demo database will show how to set up forms to refuse to open, controls
to become visible / enabled etc, tabs to display and the like.

Again, anyone interested in test driving the demo or using C2DbLWS in your
onw systems please email me.  The code is fairly new so beta testers would
be good.

John W. Colby
Colby Consulting
www.ColbyConsulting.com 




More information about the AccessD mailing list