Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using Account information to secure records

Featured Replies

  • Newbies

Here's the scenario:

Once my clients have authenticated via an external server, I would like write a script in which the Account Username would do 2 things:

Populate a field named "Teacher" in on of my layouts (LessonPlanner).

Do a find that looks up all the records with that Account Username as "Teacher" in that particular layout.

I know that I will have to add an extra step for first time users in the script which will populate the "Teacher" field with the Account Username and request new record.

On top of all of this, I would like to find a way in which users would only be able to read/write their own records, and keep all others as read only.

Any ideas from the scripting pros?

Beth Bedeker

Instead of using the account name, use the privilege set name. It'd be a snap if it was "teacher". Then use "Get( PrivilegeSetName ).

  • Author
  • Newbies

All of my teachers have the same privilege set. I was looking to use their account name so that they could only access their own records.

Oh, you have a field named "Teacher".

"I was looking to use their account name so that they could only access their own records."

For that, each record needs a field in it with the account name of the user that "owns" it -- it's probaly the person that created it, but not necessarily so. Let's call this field "Owner".

Then set up the privilege set to limit the viewing of the records to [ Get( AccountName ) = Owner ].

At startup, perform find for all records where [ Owner = Get( AccountName ) ].

Because the privilege set is set to only show a user's records, even if they do a Show All Records they won't be able to see anybody else's data.

  • Author
  • Newbies

Thanks! I'll try that

This process is called Record Level Access, and following Vaughan's good advice here will allow you to set up a system that works.

You might search this forum for that term or go on over to FMPug and sign up for a Real Tech membership and inquire more on this topic.

Steven

...go on over to FMPug and sign up for a Real Tech membership...

I'll second that!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.