This topic is locked

Complex Regional Security

3/27/2021 4:17:24 PM
PHPRunner General questions
K
klyle author

We have an app with a fairly complex State/Region/Subregion/Building geo hierarchy to which we want to assign users, to provide the starting point for selecting records they can see.

So, we need to switch to different tables and to apply different AddWhere type filters to each.

For example, we do not want the guard to fill warehouse number. It should default to a certain value filled in the beginning, or from the user login. somehow - Guard must be mapped to Warehoure=N, Regional Manager to Region=X, State Manager to State=Y, etc.

It seems like we could extend the Users table with fields for each GeoLevel, Warehouse, State, Region, etc.? Loop over them on AfterSuccessful Login from smallest to largest and stop looking when we find the first value filled in?

Is there any demo code for such a system?

admin 3/28/2021

It is hard to fully grasp the problem you dealing with but it sounds like adding multiple access level fields to the users table is a viable approach.

Maybe if we could see an example of such users table with some sample data an an example of WHERE clause generated for each user, it would have been easier to understand.

fhumanes 3/28/2021

Hello:

I think this example can inspire you in your solution because the poplematic is similar.

https://asprunner.com/forums/topic/27876-guide-5-access-control-to-table-records

Greetings,
fernando

M
Mark Kramer 3/31/2021

Can you use AD in this scenerio? If so it would already break it down by OU's and groups etc.