Discussions

 View Only
  • 1.  Permissions - field access based on the value of field in a record

    Posted 05-09-2018 12:40
    I have activities form in my app, one of the field is company id in that form. A company will have many users. I want to hide specific fields in a form based on the logged in user belongs to the company or not. How i could achieve this?


  • 2.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 13:19
    Make sure the company users are all in a user field. I would use a List-User field where you can add up to 20 users. Add that field to your form rule and state When "List-User" field includes "Current User", show fields.


  • 3.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 14:06
    Thank you for your reply. But i do have more than 20 users belongs to a company, any alternative solution?


  • 4.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 14:57
    You need to find a way to group these individuals. Can you group company employees within a specific role and then use the role in a rule? Or create more than List-User field and have a rule stating if they exist in this field or the other field, then show fields. 


  • 5.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 15:00
    Hi Gil,

    This is certainly achievable (if I'm understanding correctly) but the setup is a bit tricky...especially if you have a lot of tables and/or a deep hierarchy. I mocked up a basic example below. Keep in mind this is security by obscurity, since form rules are NOT database permissions; and QB doesn't currently support field level (conditional) user permissions.

    The basic idea is to write a formula in your table that contains users; that resolves to the value of 1 if it's the current user's record and 0 if its not. THEN you can summarize that value up to your companies table, and pass it over to any child tables as a lookup. THEN you can use this field to control hide/show form rules.

    I hope that makes sense!

    Charlie



  • 6.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 15:09
    Hi Charlie,

    Although this wasn't my topic, I like your idea. I was wondering how to use a User table to make this work. 

    Avinash, Charlie's idea would work for you.


  • 7.  RE: Permissions - field access based on the value of field in a record

    Posted 05-09-2018 15:15
    ahhhhh my bad...yes my comment was directed at Avinash!

    Thanks Gil :)


  • 8.  RE: Permissions - field access based on the value of field in a record

    Posted 05-10-2018 05:36
    Hi Charlie,

    Thank you! it worked.