13 Replies Latest reply on Sep 20, 2015 9:07 PM by Suresh

    Avoid <No Access> Layout

    Suresh

      Dear All,

       

      My database has 65 Layouts with 25+ Users & 11 Access privilege types. Using FileMaker Pro 12.0v1 / Windows XP SP3

       

      Already make a homepage for those layouts who everyone can access that homepage while they Login. And so, for certain people i created a script for automatically direct to certain layout while they login.

       

      That Script is,

       

      If (GetAccountName)="John"

      Go to Layout ["Marketing Layout"(Marketing)]

      If (GetAccountName)="Steevin"

      Go to Layout ["HR Layout"(HR)]

      If (GetAccountName)="Rachel"

      Else If[ Get(Layout Access) = 0 ]

      Go to Layout["Auth Error"(Error)]

      Else

      Go to Layout["Home"(Home)]

      End If

       

      Every layout has shortcut for another layout, so except hide option(FMP12.0v1 doesn't contains hide/lock option), i tried that if they doesnot have authorization it will go to certain page which contains "Request for Authentication". After they clicked which was unauthorized layout means at the time they saw <No Access> screen.

       

      So here i required, After they logged on, while they switch to unauthorized layout while they got <No Access>, it should need to direct to "Request for Authentication" page or "Homepage".

       

      Is above script correct? Should it contains error?

       

      Help me to solve.!!

       

      Solutions appreciatiated most!!

       

      Thanks,

      Suresh

        • 1. Re: Avoid <No Access> Layout
          coherentkris

          Your script is not logical because you are missing two end if statements. filemaker will not let you save a script in this condition.

           

          If (GetAccountName)="John"

          Go to Layout ["Marketing Layout"(Marketing)]

          If (GetAccountName)="Steevin"

          Go to Layout ["HR Layout"(HR)]

          If (GetAccountName)="Rachel"

          Else If[ Get(Layout Access) = 0 ]

          Go to Layout["Auth Error"(Error)]

          Else

          Go to Layout["Home"(Home)]

          End If

          • 2. Re: Avoid <No Access> Layout
            wimdecorte

            Your script is conceptually flawed.  You are branching on individual user accounts.  You should be branching on privilege sets (= roles), not users.

             

            There should be as many privilege sets in the solution as their are roles in the system.  Each person should have one role.  If John ever leaves the company you do no want to have to change a bunch of your code to accommodate that.  Branch on John's role, not on John.  So that if John leaves and Sandy is hired, all you need to do is assign Sandy the same priv set as John had and your code will continue to work.

             

             

             

            And you really should not be using XP anymore.  Really not.

            1 of 1 people found this helpful
            • 3. Re: Avoid <No Access> Layout
              dtcgnet

              Chances are that some of the Privilege Sets have been assigned "No Access" to certain layouts. That would be why some users see the "<No Access>" message at the LAYOUT level. If the screen is completely gray and shows "<No Access>", then the LAYOUT has been designated as No Access for that privilege set. If the layout is visible, but the FIELDS show "<No Access>", then the RECORDS have been designated as No Access for that privilege set. If a Layout has been designated as No Access but you direct the user there and don't give them a way out...they're stuck.

               

              Wim's right about your script. The names of your Privilege Sets will almost never change, but you'll have users come and go. Adjust your script to be more like:

               

              If [ Get (CurrentPrivilegeSetName) = "Marketing" ]

              Go to Layout ["Marketing Layout" (Marketing)]

              Else If [ Get (CurrentPrivilegeSetName) = "HR" ]

              Go to Layout ["HR Layout" (HR)]

              Else If [ Get (CurrentPrivilegeSetName) = "Some Other Privilege Set" ]

              Go to Layout ["Whatever Is Appropriate Layout" (Whatever)]

              Else

              Go to Layout ["The layout for unauthorized people"]

              End If

               

              Make sure to have a "Go to Layout" for EVERY privilege set in your solution.

              • 4. Re: Avoid <No Access> Layout
                Suresh

                I'm really sorry. Actually My Script is,

                 

                If (GetAccountName)="John"

                Go to Layout ["Marketing Layout"(Marketing)]

                If (GetAccountName)="Steevin"

                Go to Layout ["HR Layout"(HR)]

                If (GetAccountName)="Rachel"

                Go to Layout ["MIS"(Management Info System)]

                Else

                Go to Layout["Auth Error"(Error)]

                End If

                 

                Actually i dont know how to ask this question, because I put full concert in body of the message and I forget to consider my script. I know, its a big mistake, Really sorry coherentkris !!

                • 5. Re: Avoid <No Access> Layout
                  Suresh

                  Dear wimdecorte

                   

                   

                  Actually i dont know how to ask this question, because I put full concert in explaining body of the message and I forget to consider my script here. I know, its a big mistake, Really sorry!!

                   

                   

                  The Script is,

                   

                   

                  If (GetAccountName)="John"

                  Go to Layout ["Marketing Layout"(Marketing)]

                  If (GetAccountName)="Steevin"

                  Go to Layout ["HR Layout"(HR)]

                  If (GetAccountName)="Rachel"

                  Go to Layout ["MIS"(Management Info System)]

                  Else

                  Go to Layout["Auth Error"(Error)]

                  End If

                   

                   

                  Your suggestion1 is correct only, But here how i could set the privileges?

                  For each department I could need to give access for two people!

                  So only i set those privilege for John - HR Dept, Steevin - HR Dept, Rachel - MIS Dept...

                   

                   

                  Ok.. Now as per privilege, I will provide access for those people (as per dtcgnet suggestion).

                   

                   

                  For an example:-

                  If (Get (CurrentPrivilegeSetName)) = “HR Privilege”

                  Go to Layout ["HR Layout"(HR)]

                  Else If (Get (CurrentPrivilegeSetName)) = "Marketing Privilege"

                  Go to Layout ["Marketing Layout"(Marketing)]

                  Else If (Get (CurrentPrivilegeSetName)) = "MIS Privilege”

                  Go to Layout [“MIS”(MIS)]

                  Else

                  Go to Layout["Auth Error"(Error)]

                  End If

                   

                   

                  Is it above script concept correct?

                   

                   

                  Your suggestion2 also correct only,  but I'm working in a company, here they didnt bought Windows7 License and didnt upgrade FMP12 to 14, But need to manage everything as a developer, as a administrator, as a database manager & one of a input given user too!

                   

                   

                  But how i make these everything easy?

                   

                   

                  Expected Suggestions & Solutions !!

                   

                   

                  Thanks,

                  Suresh

                  • 6. Re: Avoid <No Access> Layout
                    Suresh

                    Really Helpful Mr. dtcgnet

                     

                    Thanks

                    Suresh

                    • 7. Re: Avoid <No Access> Layout
                      wimdecorte

                      Suresh wrote:

                       

                       

                      Your suggestion2 also correct only,  but I'm working in a company, here they didnt bought Windows7 License and didnt upgrade FMP12 to 14, But need to manage everything as a developer, as a administrator, as a database manager & one of a input given user too!

                       

                       

                      But how i make these everything easy?

                       

                       

                       

                      I have no idea what you are asking for here...

                      • 8. Re: Avoid <No Access> Layout
                        wimdecorte

                        Suresh wrote:

                         

                         

                        For an example:-

                        If (Get (CurrentPrivilegeSetName)) = “HR Privilege”

                        Go to Layout ["HR Layout"(HR)]

                        Else If (Get (CurrentPrivilegeSetName)) = "Marketing Privilege"

                        Go to Layout ["Marketing Layout"(Marketing)]

                        Else If (Get (CurrentPrivilegeSetName)) = "MIS Privilege”

                        Go to Layout [“MIS”(MIS)]

                        Else

                        Go to Layout["Auth Error"(Error)]

                        End If

                         

                         

                        Is it above script concept correct?

                         

                         

                        Conceptually, yes.

                        • 9. Re: Avoid <No Access> Layout
                          Suresh

                          for this(marked in image) i replied, Mr. wimdecorte

                           

                          wim.JPG

                          • 10. Re: Avoid <No Access> Layout
                            wimdecorte

                            Suresh wrote:

                             

                            Dear wimdecorte

                             

                             

                            Your suggestion1 is correct only, But here how i could set the privileges?

                            For each department I could need to give access for two people!

                            So only i set those privilege for John - HR Dept, Steevin - HR Dept, Rachel - MIS Dept...

                             

                             

                             

                            Think "roles".

                             

                            If John and Steevin need specific access that other people in the HR Dept do not need then there are two roles: one for John/Steevin and one for the rest of HR.

                             

                            So let's create one Priv Set named "HR Dept" and one "HR Dept - special" (or whatever name describes John & Steevin's role better, could be "HR Dept - Supervisor" or "HR Dept - Manager",...

                             

                            Same with other departments.

                             

                            Then in your script you can do:

                             

                            If (Get ( AccountPrivilegeSetName )) = “HR Dept”

                            Go to Layout ["HR Layout"(HR)]

                            Else If (Get ( AccountPrivilegeSetName )) = "HR Dept - special"

                            Go to Layout ["HR Layout - special"(HR)]

                            Else If (...)

                            End If

                             

                            Note that I am using Get ( AccountPrivilegeSetName ) instead of Get(PrivilegeSetName).  That protects against accidentally or on purpose togging the script to run with full access.

                            1 of 1 people found this helpful
                            • 11. Re: Avoid <No Access> Layout
                              Suresh

                              Ya!! Understood clearly !! Thanks.. Thank you so much wimdecorte

                              • 12. Re: Avoid <No Access> Layout
                                JeffYurka

                                Suresh

                                 

                                It sounds like you want to deal with the no access issue only.

                                What I have done is create a subscript I call for every navigation script.

                                I call this this within every "navigate to" script.

                                 

                                If [(Get(LayoutAccess) = 0 ]

                                     Show Custom Dialog {"Access not allowed"; "You do not have access to this area."]

                                     # You could pass a parameter here with the original layout name and go to layout by calculation.

                                     Go to Layout [ original layout ]

                                     Halt Script

                                End If

                                 

                                No need to deal with individual Privilege Sets

                                 

                                -Jeff

                                • 13. Re: Avoid <No Access> Layout
                                  Suresh

                                  Dear JeffYurka,

                                   

                                  Really Very Helpful Hint .. Thanks