5 Replies Latest reply on Nov 28, 2011 6:42 AM by DavidJondreau

    User access on button

    Fagreement

      Title

      User access on button

      Post

      I'm wondering if it's feasible:

      when a certain user is logged on I don't want to access certain button (make it disable or unvisible)

      I don't like to create another layout, so within the same layout how can I put security access on a button or link?

        • 1. Re: User access on button
          DavidJondreau

          At the start of the script that the button runs, add

           

          If [ Get ( AccountName ) = "Bob" ]

          Exit Script[]

          End If

          • 2. Re: User access on button
            Fagreement

            yes, but...

            can I turn the button to visible/unvisible?

            can I turn it to non-clickable (per example the cursor change on mouse over the button...)

            or can I turn it to other color (like disable)?

             

            thanks

            • 3. Re: User access on button
              philmodjunk

              If you use a layout text object for your button instead of a standard Filemaker button, you can use a conditional format to make the button appear and disappear. The conditional format would specify a font size of 500 when you want the button to disappear.

              You can also place the button inside either a portal ( the portal filter or relationship can control whether any records appear in the portal) or an invisible tab control (One tab panel has the button, one does not and Go To Object in a script manipulates the tab control to hide/reveal the button.)

              • 4. Re: User access on button
                Fagreement

                1. if i use a button as picture (insert picture) i don't have conditional formatting

                2. i think i'll use the tab control method: but how can i lock this tab control so the user can clik on it, even if it's not visible

                • 5. Re: User access on button
                  DavidJondreau

                  There's two ways to prevent users from clicking on a tab. You can set the tab width to a fixed 0 px and remove the any line, pattern, and fill from the borders and body. Or you can create a new tab control with one tab, the height of just the tabs from the tab control. Place that new tab control over the original.

                  Name each tab of the button tab control and use an OnLayoutEnter script trigger with a Go to Object to check whether the user has privilieges and go to the appropriate tab.