Questions about ACL when server-side(Scripted REST API and Business Rule) read and write tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2023 10:29 PM - edited ‎04-11-2023 10:30 PM
gr['comments_and_work_notes'].getJournalEntry(-1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2023 02:58 PM
Hi, As I indicated earlier you appear to be trying to read records using POST method, where as I think you should be using GET.
Testing in a PDI, I have no issues POSTing an incident including comment\work_notes field from Postman using an authenticated user who has only snc_internal role.
Note: at first authentication ServiceNow will apply snc_internal role to any user account without roles\any user account that does not nave snc_external role.
Using the base authentication snc_internal user I can also GET incident comments for the integration user but cannot return work_notes and this will be because of AC, but a non roled query to sys_journal_field will return the work_notes.
Perhaps you could start by reviewing the vendor documentation for REST\webservices
integration and access control
and then ensure that you have base functionality working using OOB API's before moving to a custom solution.
This support article might also help you understand options for reading comments\work_notes from a task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 02:39 AM
I use POST because the third-party system I use can only send POST type requests.
And this should not be related to Get or Post. I am not directly using the REST API provided by ServiceNow, but rather a custom REST API script.
I didn't just read the incident or task directly, but I customized a table to extend the Task table
"snc_internal" I cannot find this role in my dev instance.
According to link , This requires activating CSM
I'm not sure if it's related to this But this requires a license, and it feels like it's unrelated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 03:08 AM
snc_internal is a result of the Explicit roles plug-in, it requires no license and your pdi must be quite old if this plug-in is not deployed by default.
As already suggested you should test/validate your access using OOB API’s. Once you have confirmed correct access for the account that you are using then you can focus on investigating any issues with you custom API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2023 11:04 PM
data for journal field is stored in sys_journal_field table
you need to check ACL on that table as well
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2023 12:29 AM
Thank you for your answer
"sys_journal_field" It seems to require the admin role,The admin role is normal, but based on my attempts, it is not necessary for the admin role to read journal type values
According to the ACL of the Task's "Comments and Work Notes",I added ITIL and everything became normal
My account only has itil and u_mytask_user(Automatically created role when creating tables) Role,With only these two roles, I can read and update normally.
Additionally, I attempted to create a new type journal list type field, name as u_list.
Do not use the "Comments and Work Notes" field of the parent table (Task),In this case, there is no itil, only _mytask_user can also read and write normally...For other types of fields, even without adding any roles to the account, they can be read and written normally.
I have seen GlideRecord belong to server-side scripts that seem to not comply with ACL and can directly read and write data..
However, for the "Comments and Work Notes" in the Task, it no longer works, but there are no errors. The value read is empty and can be modified through "Work Notes"(journal input field)..
This is too strange...I can't even find any reference materials