5 Replies Latest reply on Aug 20, 2010 9:34 AM by philmodjunk

    Get privilege set Who dun it with what authority

    Radcon

      Title

      Get privilege set Who dun it with what authority

      Post

      I have a script that creates a history record whenever someone logs in to my database.  I would like to be re-assured that they are logging in with the privilege set that I want them to. Access to the database is authenticated by an external server.  I tried setting a field with the Get(AccountPriviligeSetName) script step, but it always returns [Full Access], which I assume is because I am the one that opened the file originally.  The file is hosted by FMPSA, but I don't have access to any of that.

      Is there a way for my script to make an entry in a history record that enters the privilege set of subsequent users?

      Thanks!

        • 1. Re: Get privilege set Who dun it with what authority
          philmodjunk

          How are you setting the field?

          If you define a table with some text fields, you can define several fields to auto-enter account names, dates, times, timestamps and you can use an auto-enter calculation with Get ( AccountPriviledgeSetName ) to automatically enter this name as well.

          You can define a script specified in File OPtions to run when the file is opened:

          Freeze Window
          Go To Layout [AccessLog ( AccessLog ) ] //layout of the table you've just defined
          New Record/Request
          Go To Layout [//specify the layout they should see when they open the file]

          That script should create a new record each time someone opens the file and you'll be able to check this AccessLog table to see who accessed the file, when and with what account name and Priviledge Set Name.

          Note: Get ( AccountPriviledgeSetName ) is a filemaker 11 function. With earlier versions, you can use Get ( PriviledgeSetName ) but must be careful that any script using this function is not set to run with "full access priviledges".

          • 2. Re: Get privilege set Who dun it with what authority
            Radcon

            Note: Get ( AccountPriviledgeSetName ) is a filemaker 11 function. With earlier versions, you can use Get ( PriviledgeSetName ) but must be careful that any script using this function is not set to run with "full access priviledges".

            I am using FMP 10 and have that option checked; is the setting a security issue, or is this the reason I am seeing [Full Access] on all my log entries?

            • 3. Re: Get privilege set Who dun it with what authority
              philmodjunk

              If you have that option checked the Get (PrivilegeSetName) function will always return [Full Access] as this run with full access option on the script interfers with the result you need from the get function. The new filemaker 11 function was added to address this specific issue.

              If you need the script to run with full access. Create a separate script that doesn't run with full access and call it from your "run with full access" script. This subscript can then successfully use the get function to return the user's privilege set name.

              • 4. Re: Get privilege set Who dun it with what authority
                Radcon

                The log script needs to run with full access privileges since it creates records in a layout forbidden to most users, and who also do not have new record privileges.  (I want  to hide the log).  So is it like this?

                Log script (with [Full Acess])

                SubScript with Get(PrivilegeSetName) step (no full access)

                Rest of Log script

                • 5. Re: Get privilege set Who dun it with what authority
                  philmodjunk

                  That's the idea. Your main script can be full access and your sub script need not be.