I am normally the last person to make a suggestion regarding Servoy and anything but I have been thinking about the same issues.
I also have a short sighted/practical streak so this solution would really only work with a reasonable number of clients that won’t change that often.
One way of skinning this cat would be to have a filter table with a record for each group you wanted to provided various filtered record access to. For example, client table with a unique clientid.
Then create groups in servoy’s built in sercurity piece for each entry in your client table. Each security group in servoy is given an id number and you can manually enter that group id in your Filter table (ie clientid in my example).
Upon a users login you can figure out a users servoy security group and match it against your filter table unique id. Then set a global with that number and use it to filter your various tables with the idea Westy and HJK were referring to.
A nice perk is that you link the filtering functions servoy provides to servoy security, albeit with some manual work arounds. Also, once a user is assigned a group in servoy security they pick up the groups filtering settings.
Now I bet a lot of folks have complaints like…
You probably have to make sure that a user in servoys security scheme is only in one group.
Your Right!
You have to manually match the servoy group id to the filter table for each new group!
Your Right!
I didn’t say it was a good solution, just one option. This is what I have in place untill someone smarter then me figures out a better solution.
-Jim
*PS. Is anyone here wistfully looking forward to the day when we can use the filter functions on related fields? I for one don’t like the idea of having to add the filter field in every table that I want to filter when I am starting at the same field from a 1-1 related table.
You said it yourself, you work with four groups.
So you have to add to every table a column: group
and filter your data on that group where the user belongs to!