If you set up a table where you list each layout and the name of the privilege sets that are permitted to access it, you can compare the user's privilege set name to that list to see if they are permitted access.
Thanks Phil, but at what point do I compare the users privilege set name to the list? Does it have to be in a script when going between layout? If it is I was hoping to avoid having to add a Get(privilegesetname) on each of the scripts in the whole database.
Well you are going to have to add some kind of code to each script anyway so I don't see any advantage to not doing that but....
Set a global field to Get ( AccountPrivilegeSetName ) in a script set to run OnFirstWindowOpen.
Define a relationship between the table where the global field is defined to your table of Layout and privilege set names.
Then you can simply compare the name of the layout to which you want to go to the list of layouts for that privilege set name to determine if there is a problem.
Hmmm, maybe there's a simpler way...
Set Error Capture [on]
Go to Layout [
If [ Get (LastError ) ]
Go to Layout [original layout]
Ok, thanks Phil.