Discussions

Expand all | Collapse all

Only allow a specified user to click URL Button

  • 1.  Only allow a specified user to click URL Button

    Posted 03-29-2017 16:00
    I have a URL button for approval on a form. Above this I have a field where the user is picked. Is there a way to restrict access so that only the user specified can press this button? I have achieved this directly on the form using a form rule, but this button is also on reports that I would like to restrict the access as well. Additionally, if possible, can I restrict this button without making it hide from the form.

    I have provided images. The button I am referring to is the "Employee Agrees" button. I would like only the user listed in the "Employee Name" field to be able to press this. I can achieve this through form rules, but the field still shows on any reports. I have this embedded on another table, so I need to be able to have this restriction there as well. 

    Any help would be greatly appreciated!
    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1574893/RackMultipart20170329-27793-15zct6w-Screen_Shot_2017-03-29_at_11.52.35_AM_inline.png?1490803149">">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1574895/RackMultipart20170329-65418-1m8x7fv-Screen_Shot_2017-03-29_at_11.57.01_AM_inline.png?1490803156">


  • 2.  RE: Only allow a specified user to click URL Button

    Posted 03-29-2017 16:03
    You can set any field to View, Modify or None for each Role.  Access the field and scroll to the bottom of the field characteristics to set the Role Access Permissions by Role.  Set Roles you don't want to see the field to "None


  • 3.  RE: Only allow a specified user to click URL Button

    Posted 03-29-2017 16:04
    If your [Employee Name] field is a User field, then you can do it by making the formula cantain an if that evaluates the current user:

    If([Employee Name]=User(), "My button formula for employee agrees goes here", "")

    That will show the button for only the user in the employee agrees section, otherwise it will be blank.


  • 4.  RE: Only allow a specified user to click URL Button

    Posted 03-29-2017 16:09
    Sorry, I am really quite new at formulas in QuickBase. How would I add this additional IF function to my current formula? The formula currently in the button is:

    var text url =
    If([Employee Agrees Check]=false,
      URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
        "&rid=" & [Record ID#] &
        "&apptoken=cp2kg3vbugcf22bd656gmp4udhs" &
        "&_fid_9=true");

    If([Employee Agrees Check]=false,
    "<a class=\"Vibrant Primary\" href=\"javascript:" & "$.get('" & $url &
        "', function(){" & "location.reload();" & "});" &
        "void(0);\">Employee Agrees</a>"
    )


  • 5.  RE: Only allow a specified user to click URL Button

    Posted 03-29-2017 16:25
    Put it before your second section.... with a slight change

    If([Employee Name]=User() AND [Employee Agrees Check]=false,
    "<a class=\"Vibrant Primary\" href=\"javascript:" & "$.get('" & $url &
        "', function(){" & "location.reload();" & "});" &
        "void(0);\">Employee Agrees</a>",
    ""
    )


  • 6.  RE: Only allow a specified user to click URL Button

    Posted 03-29-2017 17:00
    Thank you! This appears to have worked perfectly!