Join the Team Forms community

Dynamic Permissions

Updated 3 weeks ago

It would be great to have permissions based on usernames from selected from a User Component that a user inputs. Right now permissions is pre-determined to whoever has been set by the form builder as per below.



E
1 comment

Hi Adrian,

This should already be possible to achieve either using one of the following methods:

  1. Conditionally showing/hiding components based on the selection in a user component using javascript

  2. Using custom logic to dynamically enable/disable components based on the selection of a user component

For example using method one you could use the steps below to only allow the selected user to see and edit a specific section of your form:

  1. Drag and drop a user component into your form

  2. Drag and drop other components into your form which you want to make avialable conditionally. In this example let's use a panel component.

  3. Under the "conditional" tab of the panel component, add the following javascript to the "Advanced Conditional" property. This expression checks that the logged in user matches the selected user and makes the approval section visible if this is true.

    NOTE: you will need to adapt the expression below to fit your specific form and needs.

    JavaScript
    show = tf.user?.email === data.userComponentName.mail


Here is an example of the final output.