current.canWrite does look where exactly in ACL?

ehgebla
Giga Guru

Hey everyone,

short question on Scripts together with ACL. We do have our update incident inbound action script that will update the current.comments whenever a mail is received and adds that mail.

This shall work everytime, regardsless if the user is the opener or in watchlist. Our user in watchlist CAN update the record in portal, but for some reason the script doesn't add the comments whenever a user in watchlist answers on the records.
I mean the mail do is in the history of the ticket, but the mail doesn't get copied to the additional comments as the script tells it to be. 

The received mail tells me: Update Incident : did not create or update incident using current


The script in question ends with 

if (current.canWrite())
        current.update();
}

so I was thinking it might has to do with the ACL's. However, I checked the incident table and write for incident as well as incident.comments is allowed for people in watchlist (which is why they also are allowed to update in portal, I suppose).
So how does the script decide who CAN write and updates?
What ACL will be triggered here?

Anyone has any idea? Maybe I am also overlooking something.

Regards

Elena
1 ACCEPTED SOLUTION

ehgebla
Giga Guru

We found what was the reason for it not working.
ACL needs table as well as field access.

In ACL we had write access on the record for incident.* but not for the table, just incident.

This caused the incident to update, but not to change the additional comments automatically. After creating the write ACL for the table alone, it started to work as expected.

Thanks everyone for helping me to figure it out. The debugger did the trick here to see what was the issue. 🙂
Still weird to me that it was able to update the incident via the portal though.

View solution in original post

5 REPLIES 5

ehgebla
Giga Guru

We found what was the reason for it not working.
ACL needs table as well as field access.

In ACL we had write access on the record for incident.* but not for the table, just incident.

This caused the incident to update, but not to change the additional comments automatically. After creating the write ACL for the table alone, it started to work as expected.

Thanks everyone for helping me to figure it out. The debugger did the trick here to see what was the issue. 🙂
Still weird to me that it was able to update the incident via the portal though.