7 Replies Latest reply on Feb 26, 2013 11:36 PM by Malcolm

    Help with security script

    user19289

      Hi Everyone,

       

      I'm a bit of a FM newbie so please be patient with me..

       

      I'm developing a supplier contact information database that will be externally to suppliers via IWP to update their own contact details.

       

      Obviously the supplier should only be able to access their own record and no-one elses.

       

      I have setup the priviledge set so that each supplier can only view and edit their own record.

       

      I need a script trigger (OnFirstWindowOpen) that will direct the supplier (who has their own login account) to go straight to their record. We have over a thousand records so the supplier really needs to be able to immediately view their own record rather than have to find it.

       

      Any help would be appreciated!

        • 1. Re: Help with security script
          Malcolm

          I'm developing a supplier contact information database that will be externally to suppliers via IWP to update their own contact details.

          Obviously the supplier should only be able to access their own record and no-one elses.

          I have setup the priviledge set so that each supplier can only view and edit their own record.

           

          That's the key. Well done.

           

          I need a script trigger (OnFirstWindowOpen) that will direct the supplier (who has their own login account) to go straight to their record.  We have over a thousand records so the supplier really needs to be able to immediately view their own record rather than have to find it.

           

          In the OnFirstWindowOpen script do a search on the ID field of the supplier record. Search for "*". The wildcard search will find any record that the user is allowed to see. If they can only see their own record then it will only find their record.

           

          Malcolm

          • 2. Re: Help with security script
            user19289

            Thanks Malcolm,

             

            but how do I so a search in a script?

            • 3. Re: Help with security script
              Malcolm

              but how do I so a search in a script?

               

              You should really start reading the documentation. There are loads of PDFs bundled with Filemaker that will help you with questions like this. Look under the help menu for Documentation. Also, use the built in help. It's searchable. Here's the online reference to the help item you want.

               

              http://www.filemaker.com/11help/html/scripts_ref1.36.74.html

               

              Malcolm

              • 4. Re: Help with security script
                user19289

                Thanks Malcom but I have completed FTS and have looked at the docs yet I'm still unsure of the exact script steps for this script in particular (which is why I'm posting on here).

                 

                Once I see the script steps I'll understand how it works (I do have basic script knowledge) and learn from that.

                • 5. Re: Help with security script
                  user19289

                  It's OK I got the answer from another filemaker forum.  this script looks like it will work.  thanks for your help anyway Malcolm.

                   

                  Go to Layout [layoutbasedOnYourTable]

                  Enter FInd Mode [] --> clear the pause check box

                  Set Field [YourTable::AccountNameField ; Get ( accountName ) ]

                  Perform Find []

                  • 6. Re: Help with security script
                    LyndsayHowarth

                    I can't believe you got thru the entire FTS without encountering 'Find'.

                     

                    When Malcolm suggested "that's the key" I am pretty sure he was hinting at the right (secure) way to go forward... Rather than the simplistic (insecure) perform find methodology.

                     

                    My mother used to say "the lord helps those who help themselves". Sometimes the shortcut of asking for an answer is no substitute for a bit of research. :-)

                     

                    I would like to think that in the FTS there is an exercise in using the logon account to filter (restrict) the records shown to those which match that account... in Set Privileges. The benefit is that the user can perform a find themselves to find a sub-set of their own records but never include records from another account.

                     

                    - Lyndsay

                    • 7. Re: Help with security script
                      Malcolm

                      I'm still unsure of the exact script steps for this script in particular (which is why I'm posting on here).

                       

                      Once I see the script steps I'll understand how it works

                       

                      The link I provided displayed the help page for the Perform Find script step.

                      I have completed FTS

                      That's a good starting point, I suggest you keep working through  the exercises.