July 31, 200718 yr 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
August 1, 200718 yr Instead of using the account name, use the privilege set name. It'd be a snap if it was "teacher". Then use "Get( PrivilegeSetName ).
August 1, 200718 yr 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.
August 1, 200718 yr 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.
August 1, 200718 yr 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
August 1, 200718 yr ...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