ACL on related list

richardhofing
Mega Expert

I want to allow Read access to a related list on a CI if the user has read access to the CI. I defined an ACL on the related list table for this: answer = current.u_configuration_item.canRead(), but it is not working.

The "u_configuration_item" field is a reference to the CI. My test user can read the CI record, but the records on the related list are being restricted.

 

find_real_file.png

1 ACCEPTED SOLUTION

Can you do a canRead on a field?

 

I think you should glideRecord to that CI and then do a GlideRecordObject.canRead()


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

Where did you add the script answer = current.u_configuration_item.canRead()? 

 

The ACL should be created on CI Contracts table.


Please mark this response as correct or helpful if it assisted you with your question.

richardhofing
Mega Expert

Yes, the ACL is created on the CI Contact table:

 

find_real_file.png

Can you do a canRead on a field?

 

I think you should glideRecord to that CI and then do a GlideRecordObject.canRead()


Please mark this response as correct or helpful if it assisted you with your question.

richardhofing
Mega Expert

Hi Sanjiv, you are correct, that is what I did (ss below) and it works perfectly. Thank you very much!

 

 

var gr = GlideRecord('cmdb_ci');
if(gr.get(current.u_configuration_item))
answer = gr.canRead();
else
answer = true;