I am working on implementing the use of a PREFERENCE table in my billing solution. I have create a preference record for each user. Each user is created in SECURITY. When they log in, I want them to only see their record in PREFERENCE. As to other tables, I do not want any restrictions. Every user should be able to see any record. Can someone give me a hint to get started?
It's a little unclear whether by 'SECURITY' you have a table named that, or you are just referring to FileMaker accounts created in the Manage Security area. I'll assume they're just FileMaker accounts - but this should also work if you actually have a security table, with 1 record per account...
each user account has an account name, which you can evaluate for a logged in user through the function Get ( AccountName ) which we will user in a moment...
On your Preferences record you need something to identify which account each record is for, i'll assume a field named "account" which contains the account name of the user.
1. So, in the file now choose File -> Manage -> Security
2. Go to Privilege sets, add one if not already (otherwise use your existing one).
3. In privilege setup, under "data access and design" choose the records drop-down and choose 'custom privileges'
4. locate 'PREFERENCES' in the table list, highlight it, then at bottom under 'set privileges' area, choose the view drop down and choose 'Limited'. This will open the calc dialog.
5. Your calculation will be something like: "Get ( AccountName ) = PREFERENCES::account" , so in other words the logged in users account must match the account name of the preferences record in order to view it, otherwise they have no view access.
you can repeat that for edit/delete etc as required. For all the other tables in the privilege set just set view/edit/delete/create/field access etc to "All"