Database Reference
In-Depth Information
For now, only those people with full access can delete customer records. You'll write
and test an extended-privileges-checking script before you add the extended privilege
to the Project Manager privilege set.
3. Click OK to close all dialog boxes .
You aren't prompted for full access credentials because you didn't edit any accounts.
Figure 18-16. The Edit Extended Privilege window lets you give your extended privilege a keyword
and a description. The description should say what the extended privilege is for. The keyword can
be anything you want; it's what you'll look for in your scripts, so if you change it later, the script
may break. Activate an extended privilege by clicking the checkboxes.
Checking for an Extended Privilege
Now you need to write your script. Use the Get(AccountExtendedPrivileges) function to
ask FileMaker for the list of extended privileges turned on for the active privilege set (in oth-
er words, the privilege set assigned to the account name the user opened the file with). The
script checks to see if this list includes “delcust,” and takes the appropriate action. While cre-
ating this script, you need to add a new text field called DeleteFlag to the Customers table.
You can see the finished script in Figure 18-17 .
Try out your script by running it from the Customers layout. Your [Full Access] account
should delete the customer record, since you have the [Full Access] privilege set. Close the
database and then open it again. This time, log in as someone assigned the Project Manager
privilege set. Project Manager doesn't have the “delcust” extended privilege turned on, so
when you run the script this time, it sets the DeleteFlag field instead of deleting the record.
Search WWH ::




Custom Search