Requirement to allow members of a specific group to edit a closed record

pj13
Tera Contributor

Hi,

 

I have a requirement to allow members of a specific group to edit fields on a closed record. By default fields are set to readonly on closed.


I've tried doing the display BR + onLoad Client script & scripting a UI Policy & ACLs but nothing is working so not sure what to do or what I'm doing wrong.

 

Seems like this should be pretty straightforward.

11 REPLIES 11

Aman Kumar S
Kilo Patron

Hey,

Not sure what you have tried so far, it would be much more convenient to reply if you share exactly what has been done.

Beyond this, to handle such cases ACLs are the way to go?
How exactly you are checking up for the group members in the write ACL, and make sure to add condition state is closed.

 

 

Best Regards
Aman Kumar

Hi @Aman Kumar 

Related to some other posts with a similar topic using a display business rule call scratchpad to check membership with an onload client script calling scratchpad

 

BR

(function executeRule(current, previous /*null when async*/ ) {
    g_scratchpad.isMember = gs.getUser().isMemberOf('GroupA');
})(current, previous);

Client Script

function onLoad(){
	if(g_scratchpad.isMember.toString() == 'true'){
		// make all fields readonly
		var fields = g_form.getEditableFields();
		for (var x = 0; x < fields.length; x++) {
			g_form.setReadOnly(fields[x], true);
		}
        g_form.setReadOnly('close_notes', false);
        g_form.setReadOnly('assignment_group', false);
        g_form.setReadOnly('assigned_to', false);
        g_form.setReadOnly('cmdb_ci', false);
	}
}

 

also tried a UI Policy running on conditions with a script

function onCondition() {
    if (gs.getUser().isMemberOf('GroupA'));

 

also tried an ACL incident.field and conditions set the same as they are for the UI Policy

answer = gs.getUser().isMemberOf('GroupA');
    //answer = true;

 

I've tried all of these active on their own so there would be no conflicts but nothing seems to work. I must be doing something wrong.

I am assuming you are using incident record, if not you can check the scurity rules.

At least for incidents we have ACLs setup which excludes anyone from updating th record in closed states, so only a new acl can enable any user to edit the incident form. 

Have a look at the condition at the bottom, your script for ACL looks alright, create a new write ACL on table level, and add the script, it should workfind_real_file.png

 

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

hey @Aman Kumar  Thank you for following up again. Unfortunately I cannot run this off role, it needs to be based on group membership. Only users within a particular group can edit a closed record, not all users with itil.