Sign in to follow this  
Followers 0
Answers

Restrict Access to a Tab Panel

5 posts in this topic

I have a layout that has many tab panels. We are using Filemaker 12. There is one tab panel that only a couple people should have access to, I thought i could assign a script to OnTabSwitch, so if you were a member of a certain privilege set you'd get a message and be redirected back to the tab you were on.

 

I get the message to come up but it won't Go To Object, I'm somewhat frustrated, it seems like it should be rather simple.

 

The script is attached, I have  a few extra steps because I have been messing with this issue for a while today.

 

Any help would be GREATLY appreciated! Thanks

 

post-65628-0-04740400-1406049555_thumb.p

Share this post


Link to post
Share on other sites

The idea here is to cancel the triggering event by exiting the script with a false result, for example:

Allow User Abort[Off]
If [ GetValue ( Get(TriggerTargetTabPanel) ; 2 ) = "MyRestrictedPanel" and Get(AccountPrivilegeSetName) ≠ "AllowedPersonnel" ]
 Show Custom Dialog [...]
 Exit Script [Result: 0]
End If

This will result in user remaining on the current tab panel when the two conditions above are true.

 

 

IMPORTANT:

This is purely a cosmetic device. There is no real security in anything that's set up using layout measures. Always use accounts and privileges to make sure users cannot access data they are not supposed to see or modify.

Share this post


Link to post
Share on other sites
[…]
If [ Get(TriggerTargetTabPanel) = "MyRestrictedPanel" and Get(AccountPrivilegeSetName) ≠ "AllowedPersonnel" ]

 

Just to confuse matters a bit:   :smile:

 

Get ( TriggerTargetTabPanel ) returns a list with the index number and the object name (if any) of the target tab, so UIM, the above expression should read:

If [ GetValue ( Get( TriggerTargetTabPanel ) ; 2 ) = objectName … etc. ]

http://fmhelp.filemaker.com/fmphelp_12/en/html/func_ref2.32.86.html#1053326

Share this post


Link to post
Share on other sites

@eos: you're absolutely right. I have edited my previous answer. Thanks for the catch.

Share this post


Link to post
Share on other sites

I meant to thank you for your help, it worked! I had the first part right it was the Exit Script [Result: 0] that I missed! Ugggh!

 

It's the little things!  :laugh2: 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Change Tab Panel Colors??
      By raymanj
      I was wondering how to change the colors of tab panels.  For example the onyx theme, the tab panel content area has a different color than the tab panel title headers.  The active panel's content area is a dark gray while the title part has a black background color with light gray text.  I can see how to change the text color and the fill color for the content area, but not the background color of the title area of each tab.
      Can anyone point me in the correct direction in the inspector pan under appearances?
      Filemaker 14 adv

    • Object placement completely different in WebDirect vs. FMP
      By artvault
      Has anyone come across this behavior? See image attached... it appears that WebDirect is unable to render objects placed in the tab area of a tab panel.
      Any ideas/recipes/workarounds?

    • Tab Panel Object Name
      By Turbojesse
      In FM 12 Advanced
       
      I cannot get the Tab Panel Script Trigger script to return a Tab Panel Object Name using either of the Get functions:
       
      Get(TriggerCurrentTabPanel) or Get(TriggerTargetTabPanel)
       
      I have used the GetValue(Get(TriggerCurrentTabPanel);2) but it returns nothing. Using the same function GetValue(Get(TriggerCurrentTabPanel);1) returns the Panel Tab Number.
       
       
      I've watched videos of people doing this and I've copied examples but cannot get it to work.
       
      Anyone have a suggestion?
       
      Thanks,
       
      Jesse
      Filemaker Pro 12 Advanced 
      Mac OS X 10.8