Record Level Security

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Record Level Security

Postby Clive Sanders » Thu Mar 11, 2004 4:12 pm

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.
Clive Sanders
 
Posts: 92
Joined: Mon Jan 26, 2004 7:42 pm

Postby Jan Aleman » Thu Mar 18, 2004 9:27 pm

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.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Clive Sanders » Thu Mar 18, 2004 9:44 pm

Thanks for that Jan. I will give it a try.
Clive Sanders
 
Posts: 92
Joined: Mon Jan 26, 2004 7:42 pm

Postby jcompagner » Fri Mar 19, 2004 12:36 am

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)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Clive Sanders » Fri Mar 19, 2004 12:52 am

That looks interesting, I'll give that a try as well. Thanks.
Clive Sanders
 
Posts: 92
Joined: Mon Jan 26, 2004 7:42 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 12 guests