Child pages
  • How to configure and use restrictions on ConfiForms fields

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

This is the documentation for ConfiForms Server/Data Center app

However, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.

In ConfiForms app you can setup view and edit restrictions for a field. This is done by configuring the ConfiForms Field Definition macro using the following parameters

You can specify usernames or security groups, or can have a mix of usernames and security groups.


In this recipe we focus on "Edit restrictions" parameter


Since ConfiForms version 2.0.34 we have improved the logic for handling restricted fields. Here is how this works.

Imagine a simple form, with just 2 fields - one is not restricted and another one is restricted for edit

<ac:structured-macro ac:macro-id="c50dabb4-481e-4fc1-b3fc-b32b5de5dd00" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="09646aa0-9de5-4be3-a286-dfe8ffa9a960" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="444c3a5d-6796-4faa-8b3c-9c23c7467c0d" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">t</ac:parameter>
        <ac:parameter ac:name="fieldLabel">t</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="1697d6d3-67a7-4984-89dd-0c83d98ed16c" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="editRestrictions">no_one_can</ac:parameter>
        <ac:parameter ac:name="fieldName">trest</ac:parameter>
        <ac:parameter ac:name="fieldLabel">t restricted</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>

      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

One field has edit restrictions set to "no_one_can". We just made up a security group name that doe snot exist in our server, so the field will be restricted for edits to everyone

The form then looks like this (edit restricted field is not shown)

The field "t restricted" is not shown and even if it is with "required" attribute the form submits

If you create the view over the data then the field value will be shown, as there are no "view" restrictions on the field

There is also a ConfiForms EntryViewer macro added to the TableView, and rendered as "Show" button.

Clicking on this button brings up the read-only view over the stored data and it looks like this (edit restricted field is shown)

TableView is configured like this

<h2>Using TableView to show the data</h2>
<ac:structured-macro ac:macro-id="62a9f8ec-b3df-4bee-9421-e2ea08fba0ed" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="f93568b4-03ea-471d-9d78-3c5874a0245e" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">t</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="97adae37-92d6-4428-afb8-92bc87f6cdca" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">trest</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="e27274f9-783d-4d82-a434-d7ffa0d56fa9" ac:name="confiform-entry-viewer" ac:schema-version="1">
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>




  • No labels