VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources]

Cynthia L. Baron, Daniel Peck

نسخه متنی -صفحه : 227/ 166
نمايش فراداده

Setting Access Privileges by Password

In multiuser environments, there are many occasions when you want very specific and targeted control over each user's actions. Instead of giving (or withholding) blanket read or write access to all records, you need to let a user have full control of some records but read-only or even no access to others.

In this example, we set privileges so that users with a particular password can see any record in the database, but can only edit or delete records that they created.

To set access privileges by password

1 .

Choose File > Define > Database. (Control+Shift+D/Command+Shift+D). Click the Fields tab.

2 .

When the Define Database dialog box appears, type Creator for the field name, choose Text (Control+T/Command+T) as the Type, and click Create.

3 .Double-click the Creator field. When the Options for Field dialog box appears, click the Auto- Enter tab.

4 .Click the Creation check box and choose Account Name from the drop-down menu (Figure 16.30). Click OK twice.

Figure 16.30. The Auto-Enter AccountName option identifies the user who created a record.

When a record is created, the name of the person who created it, based on the password used, will automatically be inserted in the Creator field.

5 .Choose File > Define > Accounts & Privileges. Click the Privilege Sets tab.

6 .Double-click the Privilege Set that will have the restriction. When the Edit Privilege Set dialog box appears, click the Records drop-down list in the Data Access and Design section and choose Custom privileges.

7 .

When the Custom Record Privileges dialog box appears, choose limited from the Set Privileges: Edit drop-down menu (Figure 16.31).

Figure 16.31. The limited edit privilege will only allow access to the field data if a condition is met.

[View full size image]

8 .The Specify Calculation dialog box will appear. In the field list on the left, double-click the Creator field. In the Operators list, double-click the = (equals) operator.

9 .From the View drop-down menu on the right, choose "Get functions."

10 .Double-click the Get(AccountName) function (Figure 16.32). Click OK.

Figure 16.32. Get(AccountName) returns the name of the current user.

11 .

In the Custom Record Privileges dialog box, choose limited from the Set Privileges: Delete drop-down menu, and repeat steps 810.

12 .

Click OK three times to finish. The Confirm Full Access Login dialog box will prompt you to enter the master (full access) password (Figure 16.33).

Figure 16.33. When you close the Edit Account & Privileges dialog box, you will always be prompted for the full access password.

When users open the database using the password you configured, they'll be able to edit and delete only records that they created, although they can still browse records created by others. You can still have full access to all records by opening the file with the master account.

Tips

Although we didn't do so in this example, you can follow the preceding steps to limit a user's ability to browse records as well.

If you add this function to an existing database, it will work only on new records unless you go back and enter the appropriate user in each record's Creator field.