Are you running the script with Full Access.
Bingo. Thank you.
This means that Get ( PrivilegeSetName ) asks for the privileges of the script, but not the user's "actual" privilege set?
Hm. It looks like I should use the account names to retrieve the actual privilege set. For this I usually use my User table. But this doesn't work either: There is a relationship MainTable::cGetAccountName=UserTable::AccountName, with cGetAccountName not being stored. Via this relationship I usually can retrieve the user's privilege set that is stored in the field UserTable:: PrivilegeSetOfUser. But in this case the result of this calculation is put in a field while in Find mode, and the Data Viewer shows that UserTable:: PrivilegeSetOfUser is empty when the script is in Finde mode.
So, the question is how to use the user's account name to retrieve his actual privilege set without the User table. Any idea?
I don't think it's as complicated as you might think.
When the script runs with FullAccessPrivileges, that little checkbox overrides the actual account privileges when in the script. Thus when you Get(PrivSetName), it returns "Full Access", regardless of the user. Unchecking the box takes off the 'override' and looks at the actual user's PrivSet.
As long as the box is unchecked, you should be in the clear.
Round out this topic by looking at other posts on the forum about Get(PrivilegeSet)...there are a couple of other little quirks with it that may or may not apply to your situation.
Thanks, but for certain reasons I need to run the script with Full Access Privileges...
I never tried what I'm about to propose, so take it for what it is. If there is an existing 'best practice', I hope that another will post what it is or a link to it.
for certain reasons I need to run the script with Full Access Privileges...
You sure...? It seems that only certain PARTS of the script need to be run with FullAccess. What about separating them to pull out the part that can't be run under FullAccess?
Script1: (does NOT run with FullAccess)
SetVariable ($$PrivSet ; Get(PriviligeSetName) )
Script2: (Runs with FullAccess)
Perform Script (Script1)
If ($$PrivSet = "whatever")
Having not tried it, I don't know if the FullAccess would carry over to the other script or not. If not...this would sure beat building a table architecture to carry all the info.
If the "FullAccess" carries over to the other script, you could sub out the FullAccess tasks to the other script and trap the variable before you enter a FullAccess Script.
Just thinkin' out loud....
The sub-script could be as simple as:
Exit Script [ Result: Get ( PrivilegeSetName ) ]
Then in the main script, use:
Get ( ScriptResult )
Get ( PrivilegeSetName )
<!-- StartFragment -->
Hey comment and Ninja,
Thank you for your input.
Separating the script worked very well. The calling script does not override the setting of the subscript's privileges.
I went for comment's suggestion to retrieve and pass on the name of the privilege set (as I try to avoid global variables).
I've tested the solution, am very content. (And have learned a lot about running scripts with full access privileges
Mike<!-- EndFragment -->