How can I set permissions for a user to view the company records?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have setup the base support application and am trying to modify it to meet our needs. I would like to have a client facing view of all records submitted for that company (not just that user). I created the table Client which includes the user's company (because the contact field was not user based). My question is, how do I set permissions so that the client user can see not only the tickets (records) they submit, but any tickets submitted by someone from the same company? I am fairly new, so please break it down like you are talking to a 10 year old. Thank you!
Photo of Rebecca

Rebecca

  • 94 Points 75 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,780 Points 50k badge 2x thumb
No problem.

The way NOT to do this is to have a Role for each Company and add users into Roles.  That just leads to a nightmare of Roles.

You need to set up a Table of Client, which you seem to already have, but the important part is that the Key field of that table.needs to be set to be the userid.

I presume that you already have a relationship where Company has Many Clients, ie, they are the contacts at each company.

The magic here is that on any table where you need to control access, say the Tickets table, you make a field called Current User with a formula of

User()

That formula will always return the value of the current user.  

The. You make a relationship back to the Client Users table based in that relationship, so that 1 Client had many tickets and the [Current User] field is selected on the right side (reference field) of the relationship.

Then look up the Company of that User down to the Tickets table and call it [Current User's Company]

Lastly, set up a single Role called Clients and set the Custom Rule Permission to limit Tickets record they can view to where the field [Current User's Company] is equal to the value in the field Company.

Feel free to post back if you get stuck anywhere along the line.
Photo of Rebecca

Rebecca

  • 94 Points 75 badge 2x thumb
Ok, so I have the Client table, which is setup with the Client Contact Assigned to field as the primary key (user). I have the relationship set up so that one client can have many cases. The fields set in the reference table are Client Contact Assigned To (user-reference) and related client. I think I'm stuck on the part where you say "Then look up the company of that User down to the tickets table and call it [Current User's Company] is equal to the value in the field company".  I feel like I'm close but probably overthinking it.

As it stands now, I have Users.... I have contacts (clients), which aren't user fields)... I have Employees (user fields)... I have Clients (User fields).... It seems redundant to have contacts and Clients. Is there a way I could just replace all of the contacts with Clients to simplify things? This way they don't have to enter their information twice.

I'm sorry. I am like REALLY new to this and the relationships are killing me. I feel like a screenshare and phone call for about 30 mins would solve my issue. Is there any type of help like that?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,780 Points 50k badge 2x thumb
Can you contact me off line via the information in my profile?