6 Replies Latest reply on Sep 17, 2016 1:11 PM by philmodjunk

    User views only the record with that user's name

    nick@cg-masters.com

      Good Day.  I am brand new to Filemaker so please bear with me.

       

      I have a number of records.  I would like any given user to only have read access to only one record that has their name.

      Can this be done?

       

      If so, please explain.  Thank you

       

      N Boughen

        • 1. Re: User views only the record with that user's name
          alangodfrey

          In the File-> Manage -> Security menu you can define Privilege Sets, and what each set can do.  You can define that members of a Privilege Set can only see records where AccountName = TheirName (in principle).

          • 2. Re: User views only the record with that user's name
            nick@cg-masters.com

            Thanks for pointing me in the right direction.  I'll give it a go.

             

            N

            • 3. Re: User views only the record with that user's name
              philmodjunk

              But that just "covers" the other records with "access denied" screens--not very user friendly. You can make things nicer for your user by performing a find to pull up just the one record.

               

              In fact, once manage security is set up correctly, any find will produce a found set limited to just the records the current user is permitted to view.

              • 4. Re: User views only the record with that user's name
                nick@cg-masters.com

                OK that makes sense, in theory.  As a new user, I'm a little lost.  Is there a resource that will teach me exactly how to:

                 

                -set up manage security correctly

                -Perform a find at the time the user logs on so the user only finds the record with their name

                -display the found record to the user.

                 

                Thanks

                • 5. Re: User views only the record with that user's name
                  philmodjunk

                  First things:

                  Put a field in your table that auto-enters the account name when created. If you have existing records, you'll need to use replace field contents or another method to update these fields with an account name to match that which will be entered for new records as they are created.

                   

                  Every user must have their own account and password set up in Mange Security. If their access privileges are to be the same (can only view "their" records), then they all can be assigned the same privilege set. You can use to create a new privilege set or edit an existing one--if you haven't set up any accounts and passwords on the file, you'll want to set up a "full access" account for yourself first and be careful not to lose/forget that password. Keep in mind that passwords are case sensitive. And make a back up copy of the file before trying to set up passwords for the first time. That way, if you accidentally create a case where you can't figure out how to open the file with full access rights, you can discard that file and try again with a new copy.

                   

                  When creating a new privilege set for your limited access users, be careful to select "All" from the "available menu commands" drop down. You can change this to a more limited option later, but this will keep the menus as you are used to seeing them for the moment. Select "All view only" for layouts and value lists. Select "all executable only" for scripts. Select "Custom Privileges" for Records, select your table by clicking it and then change the "view" menu at the bottom to limited. This opens a calculation dialog where you can enter something like:

                  AccountNameField = Get ( accountName )

                   

                  Use the name of your field that auto-enters the account name where I have used "accountnamefield".

                  • 6. Re: User views only the record with that user's name
                    philmodjunk

                    To set up a script that finds all records that the user is permitted to view when the file opens, do the following:

                     

                    Create this Script in the Scripts Workspace:

                     

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

                    Set Field [YourTable::anyFieldThatIsNeverEmpty ; "*" ]
                    Set Error Capture [on]
                    Perform Find []

                     

                    Save your script and then open File Options from the File Menu. Select the Script triggers tab and set up the OnFirstWIndowOpen trigger to perform the above script.

                     

                    Notes about this script.

                    For "anyFieldThatIsNeverEmpty", I generally specify a field that auto-enters either a serial number or get(UUID).

                    "Restore" should not appear in either Enter Find Mode nor Perform Find

                    Only the single pair of square brackets [    ] shown should appear in the set field step if it's set up correctly.