How We can use Nobody Role ?

Vishal Savajia1
Kilo Sage

HI Team, 

 

A) I have requirement to restrict one column from editing in List View?  No one can edit this including admins, I have already implemented ACL and is working for me. I would like to know how we can use NoBody role ? Can anyone provide insignt on this role.

1 ACCEPTED SOLUTION

xiaix
Tera Guru

Late to the party on this one, but here's how I was able to set the 'nobody' role for a list_edit ACL that I had:

Step 1: Create the ACL you want and add some role, doesn't matter what.

find_real_file.png

Step 2: Type in 'sys_security_acl_role.list' into your main filter navigator and hit Enter

find_real_file.png

 

Step 3: Find the ACL role record you created in step 1, you can filter as shown here.  Once you see the record, right-click on it and "Copy sys_id":

find_real_file.png

 

Step 4: Place the following code into a background script and run it. **NOTE** use the sys_id that you just copied and put it into the rec.get() and don't use mine... lol

Also, the "nobody" role sys_id should be the same across all instances.  If not, it's easy to find.

(function(){
	gs.getSession().setStrictQuery(true);
	var rec = new GlideRecord("sys_security_acl_role");
	rec.get("54c7e7a3dbf5e090d0065e98dc96198a"); /* sys_id of the sys_security_acl_role record you copied */
	if (rec){
		rec.sys_user_role = 'b05940500a0a0aa70090a4893f6ff35d'; /* nobody role */
		rec.update();
	}
})();

 

 

If you refresh that ACL record now, you should notice that you have a 'nobody' role:

 

find_real_file.png

View solution in original post

7 REPLIES 7

Thanks, this is extremely Helpful.

But I wanted to assign nobody role for an ACL in the Human Core application.

gs.getSession().setStrictQuery(true);

Above line is not allowed in scopped App, Any thoughts?

yeah, just ignore (leave out) that line.  It's a habit I've gotten into over the years to always include before any GlideRecord call.  Totally not needed though in your case.

This worked perfectly for me, thank you 🙂