Firecat1970
IS-IT--Management
Hello everyone,
I have a design question to consult.
Our system will be used by 1 master office, and many regional office.
The requirement is that
1. Master office can view/change all data inputted by all offices.
2. Slave office can only view/change data they inputted.
My question is, at which point would you place the data filtering logic by region. The probable query users would place is "Show me all Purchase Order with PO Number beginning with A1", and I want the regional filtering mechanism to work behind the scene.
Is Stored Procedure the best place to handle this?
In terms of table design, what I can think of is to use "keys and lock" method. e.g. a B-user create a new record, and the record has a column to contain value 'B'.
Each users' profile has key(s), as a HUB office user, he may have keys 'A', 'B', 'C', so he can see all records with lock = A,B or C.
I am currently use where charindex(table.column, userkey) > 0 to check whether a record is readable by a user.... is there other better implementation?
Thank you very much.
I have a design question to consult.
Our system will be used by 1 master office, and many regional office.
The requirement is that
1. Master office can view/change all data inputted by all offices.
2. Slave office can only view/change data they inputted.
My question is, at which point would you place the data filtering logic by region. The probable query users would place is "Show me all Purchase Order with PO Number beginning with A1", and I want the regional filtering mechanism to work behind the scene.
Is Stored Procedure the best place to handle this?
In terms of table design, what I can think of is to use "keys and lock" method. e.g. a B-user create a new record, and the record has a column to contain value 'B'.
Each users' profile has key(s), as a HUB office user, he may have keys 'A', 'B', 'C', so he can see all records with lock = A,B or C.
I am currently use where charindex(table.column, userkey) > 0 to check whether a record is readable by a user.... is there other better implementation?
Thank you very much.