Ok so essentially construct the “roles” by checking current user and their related company, then make sure each record has a company field and make sure the company fields match using that formula? Did I follow that correctly?
I will look into this some more later tonight. Thank you for the response!
- Sterling Long
------Original Message------
OK, here's the setup.
Create a table of Users where the K
ey field is userid. Let's call the table
Users Limited By Company.Create relationship where One Company has many Users. Great, now each userid knows the Company they need to be limited to.
Here is the magic.
Create a relationship where 1 Userid in that table has Many "records". If there are multiple tables which need to be limited you will need to do this for each table. Let's say the table being Limited is "Orders". OK so One User has many Orders. Change the reference field on the right side of the relationship from being called Related User to be called [Current User] . Of course you know that just calling a field [Current User] don't make it actually be [Current User] so we change this to a formula user field with the formula of
User()
That function returns the current user.
That's the very kernel of the magic that only Quick Base can do. So now look up Company from that relationship down to Orders, ie that will be the Company for the hands on keyboard current user,.
Make a formula checkbox field called [User allowed to see this company?]
IF([Company] = [Current User Company], true)
Now set up just 1 Role for regular users limited by company and set the Custom rules to only be able to see Orders where [User allowed to see this company?] is checked.
If you need a higher level Role with Share permissions, then go ahead and duplicate that Role but use the same type of Customer Rule to limit access. Note also that if you need that field on any child records of orders, say Order Line, you can just look up that fiel form the parent and make a similar Customer Permission Rule
Voila, one role (except you need two due to different Share permissions.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.commarkshnier2@gmail.com
------------------------------