make a field editable only to specify group

subramani
Mega Contributor

Hi,

1. I need to create a new field "Reporting" in Request form.

2. Field can be updatable only by "Service Desk" people.

3. Other user can view the field.

4. field should be grayed out when Request state is "closed".

5. Field shall be available to reporting.

I have tried to create a field and wrote two ui policies to make the field read only when state is "closed" and (g_form.getUser().isMemberof("Service Desk")=='false'.   but this was not working

Anyone help me to achieve this.

deepakbkanavikarharishkumarmark.stanger

12 REPLIES 12

Hi subramani,



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.


Harish KM
Kilo Patron
Kilo Patron

As andrwas suggested you can write ACL



if (gs.getUser().isMemberOf('groupname'))


  {


  answer = true; // allow editing


}


else {


  answer = false; // lock the field


}


Regards
Harish

subramani
Mega Contributor

Hi,



Here I have tried to make the "u_description" field is writable only by "CAB Approval" Group. But It is not working as expected.



Please correct me if I wrong.



Do I need to check the ready only box in dictionary entry of the "u_description" field.



deepakbkanavikarharishkumarmark.stanger


find_real_file.png



find_real_file.png



find_real_file.png


Hi Subramani,



You as admin may not see the effect of this as the ACL is set "Admin overrides" checked. You can uncheck this and see the impact,


or you can validate it by impersonating a user , who is member of the CAB approval group vs. another who isn't.



You can leave alone the dictionary read-only setting, the ACL should do the job.



A.


Thanks a lot Andras. It is working now