4 Replies Latest reply on Aug 1, 2012 6:21 AM by GötzReinicke

    Restrict write access to record creator ? - how ... if ...

    GötzReinicke

      Title

      Restrict write access to record creator ? - how ... if ...

      Post

      Hi,

      I'm asked do restrict the write/edit access to records data to the user which created the record. e.g. if I add a new record I'm the only one who can make modifications, but all other users may read the record.

      Regarding that, I need also the option to change the owner of a record.

      We do have one FM 10 Database with only one table which is affected.

       

      Thanks for any hint or pointer to some doc/how to.

       

      Regards . Götz Reinicke

        • 1. Re: Restrict write access to record creator ? - how ... if ...
          philmodjunk

          Assuming that each user is issued their own account and password...

          You can add a field to the table that auto-enters the account name each time a record is creatd. Then you can set up record level access controls in Manage | Security that uses this expression: AccountNameField = Get ( AccountName ) to control Write Access to each record in the table. Users with full access privilege sets will not be prevented from write access.

          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 detailed description of how to set this up.

          In addition to full access users being able to change it, you can add a script set to run with "full access privileges" that can change name stored in this field.

          • 2. Re: Restrict write access to record creator ? - how ... if ...
            GötzReinicke

            Hi, that looks excactly what I need! I'v tried some basic checks for now and it looks good.

            Do you have may be an example of how multiple users from al list might do the editing? e.g. if the creator of an record leaces our company? or is it a simple "If ... than ..." switch?

            Thanks! /Götz

            • 3. Re: Restrict write access to record creator ? - how ... if ...
              philmodjunk

              I don't see what "multiple users from a list" has to do with "when the creator leaves the company".

              You don't need a list of users for handling personnel changes, you can just edit the field that contains the name of the creator. This can be done by a full access user or by a non full access user performing a script that has the "perform with full access privileges" option enabled.

              If you want to permit access to the record for multiple individuals, there are several ways that you can set that up.

              You can list multiple names separated by return in the field or you can link the record to a set of related records where each record lists an authorized user. Or you can use a expression with Or operators to enable access to the record for the listed created plus several other names such as the account names of managers.

              With the first option, you'd use this expression to control access:

              Not IsEmpty ( Filtervalues ( AuthorizedListField ; Get ( AccountName ) ) )

              With the second:

              Not IsEmpty ( Filtervalues ( List ( AuthorizedTable::Name ) ; Get ( AccountName ) ) )

              and the third:

              AuthorizedField = Get ( AccountName )  or Get ( AccountName ) = "Manager"

              • 4. Re: Restrict write access to record creator ? - how ... if ...
                GötzReinicke

                Hi,

                thanks for your message. "multiple users from a list" has nothing directly to do with "when the creator leaves the company". There are some diffenrent situations where changing a 'hardcoded' attributes or generated fields can be used or it is much more nice to use some expressions or data from tables.

                I'll try your suggestions!