August 4, 201015 yr Newbies I have a client solution made up of two databases. The first contains all the data tables and the second, called Interface, contains all the layouts. In the Interface I have a series of seven layouts, each with seven buttons used to navigate between the layouts. There are three sets of users, the company owners, who have Full Access with full privileges, the production manager, whose privilege set is called Management, and artists who have no access to this part of the solution. Management can create, edit, and delete in all tables, view only layouts and value lists, and execute only all scripts. Each of the seven buttons is linked to a single script which validates which privilege set is being used and the additional parameter of each button (see sample below). Full Access users have no problem with any of the seven buttons, each takes the users to the appropriate layout. However, the production manager cannot access two of the layouts. When logged in using the Management privilege set the first and second buttons redirect her to the seventh layout. All of the remaining buttons work as scripted. If (Get(CurrentPrivilegeSetName) = "Management" or (Get(CurrentPrivilegeSetName) ="[Full Acess]" and Get (ScriptParameter) = "Comp List" Go to Layout ["Comp Shot List - Management" (Shots 2)] Else If [Get (CurrentPrivilegeSetName) = "Artist" Go to Layout ["Task List - Artists View V.2" (Assignments 2)] End If If (Get(CurrentPrivilegeSetName) = "Management" or (Get(CurrentPrivilegeSetName) ="[Full Acess]" and Get (ScriptParameter) = "Task Shot List" Go to Layout ["Task Assignment Shot List" (Shots 2)] Else If [Get (CurrentPrivilegeSetName) = "Artist" Go to Layout ["Task List - Artists View V.2" (Assignments 2)] End If The files are being served by FM Server 11 and all the users are using FileMaker 11. Thanks in advance.
August 5, 201015 yr What does the your calculation yield for the Production manager? You can view the results by making a calculated field: Get(CurrentPrivilegeSetName) = "Management" or (Get(CurrentPrivilegeSetName) ="[Full Acess]" and Get (ScriptParameter) = "Comp List"
August 5, 201015 yr Two things to note: 1. AND is evaluated before OR. The expression: a or b and c is evaluated as: a or (b and c) Your first If[] will return True when Get(CurrentPrivilegeSetName) = "Management", without considering the script parameter. 2. When a script is set to run with full access privileges, Get(CurrentPrivilegeSetName) will return "[Full Access]" every time - that's why they added the Get (AccountPrivilegeSetName) function in version 11.
August 5, 201015 yr This is exactly why the new privilege set calcs were introduced. You're using the old ones; they never worked in full access scripts. You want Get(AccountPrivilegeSetName).
August 5, 201015 yr Author Newbies I have rewritten the If statement as follows: Get ( AccountPrivilegeSetName ) = "Management" and Get ( ScriptParameter ) = "Task Shot List" or Get ( AccountPrivilegeSetName ) = "[Full Access]" and Get ( ScriptParameter ) = "Task Shot List" It makes no difference. When the "Management" user clicks on that button it still takes her to the very last layout. And, again this behavior only occurs with the first two of seven buttons. The remaining five operate as scripted for her.
August 6, 201015 yr I have rewritten the If statement as follows: It makes no difference. When the "Management" user clicks on that button it still takes her to the very last layout. And, again this behavior only occurs with the first two of seven buttons. The remaining five operate as scripted for her. I don't know what you think that calc is supposed to do and it is pretty much impossible to tell. You've just thrown a big jumble together and I doubt very much that it does what you think it does. Put in parentheses where the real groups are supposed to be. I suspect you intend this: ( Get ( AccountPrivilegeSetName ) = "Management" and Get ( ScriptParameter ) = "Task Shot List") or (Get ( AccountPrivilegeSetName ) = "[Full Access]" and Get ( ScriptParameter ) = "Task Shot List") But that is not what you wrote. What you wrote will *evaluate* like this: (Get ( AccountPrivilegeSetName ) = "Management" ) and (Get ( ScriptParameter ) = "Task Shot List" or Get ( AccountPrivilegeSetName ) = "[Full Access]") and (Get ( ScriptParameter ) = "Task Shot List")
August 6, 201015 yr When the "Management" user clicks on that button it still takes her to the very last layout. I am not sure what the rest of your script is doing. I'd suggest you use the script debugger to see what's happening, or make a new script for testing: If [ Get (AccountPrivilegeSetName) = "Management" and Get (ScriptParameter) = "Task Shot List" or Get (AccountPrivilegeSetName) = "[Full Access]" and Get (ScriptParameter) = "Task Shot List"] Show Custom Dialog [ "True" ] Else Show Custom Dialog [ "False" ] End If BTW, your statement could be written more concisely as: ( Get (AccountPrivilegeSetName) = "Management" or Get (AccountPrivilegeSetName) = "[Full Access]" ) and Get (ScriptParameter) = "Task Shot List"
August 6, 201015 yr What you wrote will *evaluate* like this: (Get ( AccountPrivilegeSetName ) = "Management" ) and (Get ( ScriptParameter ) = "Task Shot List" or Get ( AccountPrivilegeSetName ) = "[Full Access]") and (Get ( ScriptParameter ) = "Task Shot List") I don't think so: as I mentioned earlier, AND is evaluated before OR - and there is no need for parentheses when you are not changing the default order of evaluation.
Create an account or sign in to comment