[thelist] Looking for dynamic menus for ASP pages

Rob Smith rob.smith at THERMON.com
Wed Jul 28 08:46:37 CDT 2004


> Then develop a way of keeping track of
> users, and which groups the users belong to. (and which groups groups
> belong to, ala group nesting). Then assign groups permissions to
> objects.

...That's...what I've done. I even built an administration interface to help
me maintain the data and all the groups, permissions shmirissions, yadda
yadda yadda. 

>  You end up with increasingly nasty code up-above splitting strings 

With long sharp pointy teeth. I disagree. I haven't changed the code in
nearly two years. Very seldom I have to change the menu system. When a new
user comes in, my only questions are, "Where is this person and what do you
want them to see?" I enter their information and enter my comma delimited
list (1,2,4,9) and that's it, where each number represents an access level.

> You'd need to roll your own integrity system
> because you can't rely on the database enforcing any sort of
> referential integrity.

You cannot enforce referential integrity with comma delimited fields. Why?
In a way, it violates RDBMS theory. Each cell is supposed to contain one and
only one piece of information, not a comma delimited list. But then again,
it does contain one and only one piece of information, a comma delimited
list for user group definitions. 

When I started developing this thing many moons ago, I just couldn't bring
myself to create 50 some-odd columns, one for each user group. I should
have. In a way, now that I think about your suggestions, I think that would
work nicer and bring in what you talked about; a matrix if you will:

User | All  |  Region  |  State  |  City  |  Section of Town
-----+------+----------+---------+--------+-------------------
 A   |  x   |          |    x    |        |        x
-----+------+----------+---------+--------+-------------------
 B   |      |     x    |    x    |    x   |                   
-----+------+----------+---------+--------+-------------------
 C   |  x   |          |    x    |        |        x
...and so on. and now the menu table...
Page | All  |  Region  |  State  |  City  |  Section of Town
-----+------+----------+---------+--------+-------------------
 1   |  x   |     x    |    x    |        |        
-----+------+----------+---------+--------+-------------------
 2   |      |     x    |         |    x   |        x           
-----+------+----------+---------+--------+-------------------
 3   |  x   |     x    |         |        |        x
...all you'd have to do at this point, is mentally lay one over the other.
Where ever the x's match, a menu item is created.

By this above random example:
User A can see (All, State) on Page 1
User A can see (Section of Town) on page 2
User A can see (All, Section of Town) on page 3
User B can see (Region, State) on Page 1
User B can see (Region, City) on page 2
User B can see (Region) on page 3
User C can see (All, State) on Page 1
User C can see (Section of Town) on page 2
User C can see (All, Section of Town) on page 3

Thanks, I'll put this into the next version,

Rob


More information about the thelist mailing list