2 Replies Latest reply on Aug 26, 2013 10:03 AM by DoubleDee

    Restricting records in IWP using boolean calculation

    DoubleDee

      Title

      Restricting records in IWP using boolean calculation

      Post

           Good morning. I have one last problem after a very, very long journey to get a registration site working.

           Here's an excerpt from documentation:

           

                "6. Limiting Access On A Record-By-Record Basis — To allow or prohibit record viewing, editing, and deleting privileges to certain records within a table, you need to specify a Boolean calculation that determines whether the privilege is permitted. For each record in the database, access is allowed when the calculation evaluates to True or to a non-zero result, and access is prohibited when the calculation evaluates to False or zero.

           


      If you specify a calculation to prohibit viewing of certain records within a table, in most cases you should use the same calculation to prohibit editing and deleting of the same types of records. Otherwise, you may inadvertently allow users to edit or delete records that they cannot view."

      I have everything set up for my registration site and it's all working except for the fact that my guests can see a huge database toolbar with a button for editing records and of course seeing everyone else's records, which I obviously don't want. With a little deviousness or just a misunderstanding, I could have someone delete another already registrered customer. Or all of them.

      Here are my questions:

      1. Can I hide the toolbar on the IWP web page using FMP12? It sure is a huge problem for a basic registration site, which is a major advertised feature.

      2. Barring that, what would be the boolean calculation referenced above, if I want the user to be a guest along with other guests? (ie: no extra registration to just be a database user so you can then register). There will be an automatic hidden account # created when they enter the DB, since there is an automatic new record waiting for them, as well as the create date and time. I would think that I could use this data in some way to restrict the user from all other records, but I'm not well versed in calculations. Can anyone help or point me to some well constructed information about this?

           Thank you!

        • 1. Re: Restricting records in IWP using boolean calculation
          philmodjunk
               

          but I'm not well versed in calculations.

          Since calculations are critical and heavy used design element, that will cripple your efforts to develope a database in many areas.

          If you add a text field and use field options to auto-enter the user's account name, this boolean expression could be used to limit access to only records created by this user:

          Account = Get  ( accountname )

          where account is the text field that auto-enters the account name.

          • 2. Re: Restricting records in IWP using boolean calculation
            DoubleDee

                 I know, Phil. I'm a 20-year veteran beginner. I have a school that teaches art to kids, and do everything myself. I just keep messing around with the same database until it works like I want.

                 And your boolean calc worked great! Thank you! I created a "begin or cancel page", and it hides the toolbar when you select "begin". I also added into my script for the submit button, a page for a finish button/script that exits the program and that performs the log out. Except for the initial page, there's no confusing toolbar and everything works. I finally have an easy registration site with a link on my web page to open it. I no longer have to copy/drag everything from my form emails into my database by hand.

                 I sure wish there had been an easy description somewhere of how to do this. It's not really that hard to implement, but almost impossible to figure out.

                 Again, thanks for your help.