How to have Record Level Security for my Appian Application?

Hi, 

I have a use case where while updating an already created Form, I want to limit the user to only update a particular attribute / field in the form where the rest shows as "Read-Only"

For example, in the above case, I want to give an access to only update the Ownership % for particular users, and rest fields be "read-only".

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to AtishayJain

    You can create a flag rule input of boolean type, say ri!readOnly. When you are calling the interface for creation pass false() as the value and when you are passing from related action pass it as true. 

    next, for all your form fields, except Ownership % set the readOnly/ disabled attribute of that component to ri!readOnly. This way when you are creating all fields will be editable, and when you are updating, all will be freezed except the Ownership % field.

Children
  • Hi Harsha, 

    Thanks for your revert!

    Could you please help me with the snippet of code for the above solution?

    Also, is it possible to do so via Process Modeler?

  • 0
    Certified Lead Developer
    in reply to AtishayJain

    For your reference the steps would be as follows.

    • Create ri!readOnly rule input   
    • Configure readOnly/disabled property for each of the form fields (e.g. as in line 2 & 10),except Ownership   
       a!textField(
                        readOnly: ri!readOnly,
                        value: fv!item.desc,
                        saveInto: fv!item.desc,
                        characterLimit: 100,
                        required: true,
                        validationGroup: "main"
                      ),
                      a!dropdownField(
                        disabled: ri!readOnly,
                        placeholder: "--- Select a Category ---",
                        choiceLabels: local!categories,
                        choiceValues: local!categories,
                        value: fv!item.category,
                        saveInto: fv!item.category,
                        required: true,
                        validationGroup: "main"
                      ),
    • In the Process model pass the value - If creating the form pass false(), inside update process pass true(). 

     

    In my case this is what the form looks like when I have passed true() from the update process. I have kept shipping address editable and all other as readonly. I hope now you can configure your form and process as per your need.

  • Hi Harsha, 
    It was super helpful. Thanks for sharing this!

    Since, we have now restricted users not updating all the fields except editing "Ownership %" field, and rest all other fields are non-editable, how can this logic be applied to only allow a specific "group" of user to edit "Ownership %" field?