Re: Can you filter SELECT results? Well, it goes back to my menu problem. You see I'd like to be able to
say which menus show up for a particular person or group. Since this
same menu info will be accessed by multiple programs it would be nice
to have the logic for filtering out the menus on the DB rather than in
each program.
The way I determine if it is visible is like this (Maybe there is a
better way)
Given a userID I check the menuUserAccess table to see if there is a
record macthing that UserID and the menuID in question. If so the user
has access to it. What makes it more complex is the groups. If the 1st
test failed I'd need to get an array of groupIDs the user belongs to
from my usr2grp table. Finally I'd loop thru each of them and see if a
record exists in the menuGrpAccess table containing that groupID and
the menuID in question.
The presence of the record means the group / user has access.
Maybe this is a flawed design? |