A field of a table is to be editable by users with certain roles

Community Alums
Not applicable

Hi,

I have a requirement where a field in a table is to be editable by users with certain roles. What would be the best practice and approach? Kindly help.

Regards

Suman P.

1 ACCEPTED SOLUTION

Delete the script (because the script will remain active, as long as the field has a value) and just add the roles to the 'roles' section within the condition. You don't need to script for roles in ACL's.

And for this one: you could just add the 'cmdb_admin' role and tick 'admin override' on the ACL.

 

This will work, assuming the roles grant sufficient access to the table as well.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

3 REPLIES 3

Mark Manders
Mega Patron

Create a write ACL for just this field. If a user without such a role opens the record, it won't be editable, because of that field ACL.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Community Alums
Not applicable

Hi @Mark Manders,

I have used the ACL, can you please validate and correct if wrong.

 

1.PNG

 

2.PNG

 

answer = false;
if(gs.getUser().hasRole('admin') || gs.getUser().hasRole('cmdb_admin')){
	answer = true;
}

 

Regards

Suman P.

Delete the script (because the script will remain active, as long as the field has a value) and just add the roles to the 'roles' section within the condition. You don't need to script for roles in ACL's.

And for this one: you could just add the 'cmdb_admin' role and tick 'admin override' on the ACL.

 

This will work, assuming the roles grant sufficient access to the table as well.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark