5 Replies Latest reply on May 16, 2014 4:37 PM by philmodjunk

    Scriting a Privilege set

    Shelby

      Title

      Scriting a Privilege set

      Post

           I would like to know  how I can script:    

           1.    If the account name is not equal to  X or Y then set the privilege set to Read Only

      and also how to script:

           2.  After the last day of the previous month set privilege set to Read Only

           Both of these to be used  when the file is opened.     (not for the same file )

           Thank you very much for helping me

            

            

            

            

        • 1. Re: Scriting a Privilege set
          philmodjunk

               "setting a privilege set" would be using Manage | Security to make changes to a user's account. This could be scripted, but is that really what you want to do here?

               You can set up "lock expressions" that limit access to any record where the expression does not evaluate as true and this can be used to control access to records on a record by record basis. This can check account names (1.) and also the date of a date field in the record (2).

               See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a description of how to set this up.

          • 2. Re: Scriting a Privilege set
            Shelby

                 Thank you for your response.

            Yes I want to script priviledges.  I have a client who is using my database free of charge. This person is giving me a very difficult time.  I have access to the database now through RDC but this could change anytime

                 What I want to do if script access to the database. 

                 In other words if things were not to improve and in case I no longer have access in the near future I would like to script 

                 June 20 2014 all accounts have no access or all accounts become read only.

                  

                 Thanks for your help

                  

                  

            • 3. Re: Scriting a Privilege set
              philmodjunk

                   Take a look at the script steps found in the Accounts category in the script editor. There are several different scripts steps there that could disable or delete an account. Set the script to run with full access privileges and any user that opens the file after the specified date might run that script via OnFirstWindow open and see all their accounts change...

              • 4. Re: Scriting a Privilege set
                Shelby

                     Thanks a lot.

                     I was able to do the delete account portion, but now how to I script the date part?

                      

                      

                • 5. Re: Scriting a Privilege set
                  philmodjunk

                       If [ Get ( CurrentDate ) > GetAsDate ( "6/20/2014" ) // assuming mmddyyyy locality settings for dates ]
                         Do steps to delete the account here
                       End If.