8 Replies Latest reply on Aug 4, 2011 4:11 PM by PeterDowns

    Restricting Record Access by Account Name

    PeterDowns

      Title

      Restricting Record Access by Account Name

      Post

      Hi 

      I am not sure this is the right way or the most effective approach. 

      I have a multiple user database that have records displayed in a table called Projects. Users enter their project details but I only want them to see their own records not other users. The approach I have taken is to set up a new privilege set called teamView. I have selected custom privileges and I have filtered the table by Record_Created_By = Get(AccountName) (with this field being apart of table Records). The user with this privilege set assigned he has access to his records (so it appears to be working) however all the other records are coming up "no Access". Is there any way of hiding the "no access" records as there will be hundreds of records in the system and they don't want to have to browse through everyone.

      Plus I have set all the other custom requirements to full access or yes, but the new record and delete record are all coming up greyed out.

      If this is the wrong way of filtering records just give it too me straight.

      yours in still struggling

      Cheers

      Peter

        • 1. Re: Restricting Record Access by Account Name
          philmodjunk

          I'm not sure why you are getting the greyed out menu options here.

          To filter out the "no access" records, just perform a find in a script that runs when the file is opened or when the layout is first entered. Any find will do as "no access" records will automatically be excluded from the found set. Thus a find performed with a "find all" kind of criteria is all you may need for this.

          Enter Find Mode[]
          Set Field [Yourtable::AnyneverEmptyField ; "*"]
          Set Error Capture [on]
          Perform Find[]

          Once this script is performed, the only way your users will see "no access" records is if they choose "Show All records" or "Show Omitted Only", And custom menus ( Requires FileMaker advanced ) can even be used to change those results to keep "no access" records invisible.

          • 2. Re: Restricting Record Access by Account Name
            PeterDowns

            Hi Phil,

            thanks heaps worked a treat.

            In regard to the greyed out sections

            When this user logs on he is now seeing only the projects he had entered earlier. However the New Record and Delete record buttons in the top task bar are greyed out and the user cannot enter any new projects. In fact everything is greyed out except for the record selectors.

            OK the user is attached in manage / security to the privilege set I created called teamView

            Team View has the following features - 
            Data Access and Design:
            Records - Custom Privileges 
            All others - All Modifiable

            All other Areas 
            All ticked

            Records - Custom Privileges features:
            Everything is Yes and All except for the table 'Projects' which has it's VIEW field set to 'limited' (rest of it's fields are yes and All.
            Calculation in regards to the table Projects - "Record_Created_By = Get(AccountName)" 
            In table projects there is a field called "Record_Created_by" which is automatically filled by whoever created the project with their account Name.

            So this process all works fine except for the greying out 

            Any ideas??
            Thanks in advance

            Peter

            • 3. Re: Restricting Record Access by Account Name
              philmodjunk

              One situation that can grey out menu options is if a script is running--either in an infinite loop or one that is currently paused. You can check the status area to see if a "continue" button is showing as one will appear if there's a paused script.

              Just one possibility that comes to mind.

              • 4. Re: Restricting Record Access by Account Name
                PeterDowns

                Hi Phil,

                there is no continue button running or showing.

                Buttons greyed out are - 
                Show All / New Record / Delete Record / Find / Sort / Edit Layout / View As / Preview

                The record selectors are not greyed out however they are showing filtering ie 1/2 a green circle showing 2 of 5 records. 

                Any other ideas

                Peter

                • 5. Re: Restricting Record Access by Account Name
                  philmodjunk

                  Do you see the same options greyed out on every layout?

                  • 7. Re: Restricting Record Access by Account Name
                    philmodjunk

                    What options did you select for this privilege set in the Other Options section? Especially the "Available Menu Commands" section?

                    • 8. Re: Restricting Record Access by Account Name
                      PeterDowns

                      Bingo

                      The available menu commands were set for minimum. I just switched to All to test and they are all free to use. So happy days.
                      Thanks for the help.

                      Cheers

                      Peter