1 Reply Latest reply on Dec 9, 2015 9:47 AM by mikebeargie

    Custom Record Privileges that work in FileMaker Pro and the PHP API


      I'm working on a solution that utilises Custom Record Privileges for various Privilege Sets to determine whether users can view certain records in a Customers table. The calculation for the view custom record privileges is along these lines:


      Customers::SalesRepGroup = Interface::gUsersGroup


      where gUsersGroup is a global field that is setup via the startup script when the file first opens. This works well and we have no issues with this.


      We're now working on a simple PHP page that will let staff on the road quickly view their list of customers, however we've encountered an issue in that they can now sell all Sales rep Customer records as the formula for the view custom record privileges is obviously not evaluating correctly for the custom web publishing/PHP API clients.


      We would like, if possible, to have one formula that works for both FileMaker and CWP clients. We can't use globals as they work different with CWP vs FileMaker and we're trying to avoid if at all possible having to add additional logic to the PHP pages so that anytime they look at a Customer record/s we have to add additional compound find logic to this.


      Has anyone else being down this road before or having any suggestions about how to implement a single formula that works for both FMP and CWP clients?




        • 1. Re: Custom Record Privileges that work in FileMaker Pro and the PHP API

          What logic are you using currently to set the value in "Interface::gUsersGroup"?


          You're basically going to need to recreate that functionality for CWP. It might be easiest to create a simple accounts table that stores the user account name, and what group access they have, then add a quick find to set a session variable in PHP.


          Once you've established that group as a variable, you'll want to add it to your query for the clients list that is returned.


          Are you having users login to CWP with their own account credentials? Or did you hardcode your own CWP account credentials in?