Scripts and Security

Security and script writing intersect in two areas. First, you need to take into account the level of access people have, and whether or not your scripts will over-ride some or all of their privileges. (The previous section describes one way of doing so with extended privileges.) Second, FileMaker lets you automate some of the security features described earlier in this chapter with scripting. ScriptMaker has a handful of steps dedicated to security-related tasks, and this section shows you how to use them.

Detecting Privileges in a Script

The first way to handle security in your scripts is to deal with it directly. In the last section you learned how to check for extended privileges and take appropriate actions. If you want, you can check for specific privilege sets, or even specific account names.

  • To check the privilege set, use the Get ( PrivilegeSetName ) function. It returns the name of the privilege set assigned to the current user. Bear in mind that if you change the name of a privilege set, you have to modify any scripts that use this function.

  • If you must restrict an action to a particular account, use Get ( AccountName ) instead. As you probably expect, it returns the name of the account with which the user logged in. The same warning applies here: Beware of renamed accounts.


    If the user logged in with external authentication, then Get ( AccountName ) will give you their real account name in the external directory server.

  • Finally, FileMaker has one more ...

Get FileMaker Pro 9: The Missing Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.