Standard Record Page Controller to Check Write Access

Jamie Stroud
Tera Expert

Hello all, I'm on Vancouver. In CSM/FSM Configurable Workspace, I created a duplicate variant of CSM default record page so I'm dealing with the "Record" controller. I'm looking to get at whether the current user has write access to the record they are viewing. I was under the impression it would be data.record.isReadOnly but that output attribute does not seem to track with the user's access to the record. There's also data.record.acl but it only has attributes for canRead and canCreate.

Without creating a separate "Lookup Record" DR just to look up the user's canWrite() access, can someone direct me to something I'm missing about this Controller?

 

@Brad Tilton tagging you to hopefully get some traction 🙂

2 REPLIES 2

Haseeb-Ahmed
ServiceNow Employee
ServiceNow Employee

Hi @Jamie Stroud ,

I see, canWrite is available in "output -> form > field", and also in "top level outputs" can see read-only, you may explore these if these are useful here.

Screenshot 2024-02-17 at 1.35.59 PM.pngScreenshot 2024-02-17 at 1.35.37 PM.png

 

Please accept the solution or give a thumbs up if it answers your query.

Thanks,
Haseeb Ahmed

Hi @Haseeb-Ahmed  and thanks for the reply. If you look at my original post, I specifically call out that "isReadOnly" does not seem to track directly with the results of a check on canWrite() (on the record being viewed). I did a few tests and there were times where the user did not have write access to the record but isReadOnly was coming back as false.

On the canWrite that you show in your screenshot, that is in relation to the specific field (in your case, "close_code") not the entire record.