5 Replies Latest reply on Apr 23, 2012 3:52 AM by Sorbsbuster

    Specifying custom record limits

    johnswhitehead_1

      Title

      Specifying custom record limits

      Post

      I want to restrict access in my database so that any user can only see his/her own record plus records related to him/her in other tables.
      I set the custom record access privileges for the Registrants table using the formula "Email = Get(UserName)" (users are required to 
      use their email address as their username). For other tables that are related back to the original Registrants table I used 
      "Registrants::Email = Get(UserName)". 

      This simply doesn't work. In any relevant layout all the fields are filled with <No Access> where I was expecting most to be blocked 
      but some to be visible.

      Any clues as to what I'm doing wrong?

        • 1. Re: Specifying custom record limits
          philmodjunk

          Record level access blocks access to the entire record--not specific fields within the record. You either have access to every field in a record or none of the fields in a record. That might explain why you are seeing all fields "no access" when you expected some to permit access.

          If you have RECORDS that are "no access" for which you expected access, you'll need to take a closer look at what you have set up. For some reason, your expression is not evaluating as True when you expected it to. The first thing, I'd check is to make sure that the email file is of type text when I checked it in Manage | database | fields. In the case of the related tables, you'll also need to check and see if the relationships are functioning the way you expected it.

          • 2. Re: Specifying custom record limits
            johnswhitehead_1

            Thanks for your prompt reply. Email is indeed a text field. I tried removing the @ sign from both the account name and the email, but that didn't help. I then changed the formula that evaluates the record access so that it read Email = abc@123.com, ie the literal text of the account name, with no effect, so the problem is not the Get (UserName) part.

            What surprises me as much as the fact that the permissable records are blocked is the fact that all the field names in the layout (at least in table view) are also listed as <No Access>. Perhaps they're supposed to become live if a record becomes live, or is it an indication that i'm being blocked out at some more fundamental level?

            I'd be grateful if anyone can figure it out...

            • 3. Re: Specifying custom record limits
              philmodjunk

              Try using Get ( AccountName ) instead of Get ( UserName ). I should have spotted that one the first time. A user name is something specified in Preferences. Account name is the name used to log in when entering a password.

              • 4. Re: Specifying custom record limits
                johnswhitehead_1

                Finally worked it out: operator error! Although I had Record access set to Limited I had Field access set to None, so nothing showed, including field names. 

                 

                Lesson learned. Sorry to have wasted your time.

                 

                Best

                J

                • 5. Re: Specifying custom record limits
                  Sorbsbuster

                  But note Phil's point...  (it might be working for you now by coincidence.)