Page 1 of 1

Record Level Security

PostPosted: Thu Mar 11, 2004 4:12 pm
by Clive Sanders
I am developing a solution for a client that includes a table of customer company names and addresses, and a separate table of related contacts. I need to be able to apply some security against certain records as explained below. Would someone be able to give me some idea as to how I could go about achieving this.

Thanks in advance

Our client has requested that they want each of their own branches to be able to see only their own set of customer names and addresses together with associated headquarter names and addresses, and for certain individuals to be able to see all customer names and addresses.

For example, and assume that our client company is called Client:

Client London Branch can see XYZ Customer details
Client Birmingham Branch can see ABC Birmingham Customer details
Client Edinburgh Branch can see ABC Edinburgh Customer details
Client Birmingham and Edinburgh Branches can both see ABC Headquarters details
Client Headquarters can see all of XYZ and ABC details.

PostPosted: Thu Mar 18, 2004 9:27 pm
by Jan Aleman
The easiest would be:

1. disable the findAllCmd on the forms that have data you want to hide (so users can't do control/cmd-J to see somebody else data)
2. Override the onFindCmd with a custom method:
in that method:
fill the fields with the criteria matching the data they are allowed to see
go into find

best would be to not have the fields that contain the ownership info editable on a layout.

PostPosted: Thu Mar 18, 2004 9:44 pm
by Clive Sanders
Thanks for that Jan. I will give it a try.

PostPosted: Fri Mar 19, 2004 12:36 am
by jcompagner
you could also look ath the addFilterFoundsetParam method.
(you can set those on the onload of a form then all the records will be filterd out with what ever search they do)

PostPosted: Fri Mar 19, 2004 12:52 am
by Clive Sanders
That looks interesting, I'll give that a try as well. Thanks.