Forum Discussion

GraemeMATLAB's avatar
GraemeMATLAB
Qrew Member
4 years ago

Field-level permissions when Current User is Record Owner

Hello,
I would like to restrict access to specific fields based on the current user. From a post from 2018 it sounds like this was not possible at that time, and I'm having difficult figuring out how to do it with the current environment - is this still not possible? Here's the old post: https://community.quickbase.com/communities/community-home/digestviewer/viewthread?GroupId=103&MID=33464&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer

In my case, suppose that I have a table called "Parts," which contains a field that is the "Part Price." I want my "Administrator" role to be able to see the prices for all Parts. However, I want the "Participant" role to be able to view/modify the prices only for parts where they are the Record Owner. I still want the "Participant" to be able to view/modify other fields in the Part record, just not this "Part Price" field. So I can't use the table-level View/Modify "when user is Record Owner" option, since this would hide the entire record. 

I know that I can hide the "Part Price" using Dynamic Forms, but I still need to hide it from the "List All" and other reports. And if the "Participant" is able to create reports I assume they could just choose this field for their new report. I could make the field unselectable for reports, but I still want the "Admin" to have full control with this field. 

Does anyone have any suggestions for this? Thank you for your help!

------------------------------
Graeme
------------------------------

1 Reply

  • Well, there is actually a new function in the last year-ish or so, where for the first time a formula field can detect the Role(s) of the user.

    so you can make a formula field called [User is allowed to Edit Part Price] and then have a form rule that says when that field is true (checked) then "Make editable",

    the documentation is here
    https://login.quickbase.com/db/6ewwzuuj?a=dr&r=gj&rl=cnz

    I suggest that you stick to using the Role ID# as you don't want the formula to break just because you renamed a Role.
    not tested for Syntax but try this.  You will need to check the Role ID in your app.  They are visible in the URL when looking at a Role.


    Contains(UserRoles("ID"), "12"), true // 12 is Administrator
    OR
    (Contains(UserRoles("ID"), "11") and [Record Owner]=User()) // 11 is Participant


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------