How to stop/Restrict SN table wm_task table records are updated by "Guest" user.

BhagyaK58374570
Kilo Contributor

HI Team,

Wm_task table records fields are updated by "Guest" user. So we need to stop/restrict the Guest updates in all the tables.

How can I achieve that??

Thanks,

Bhagya

7 REPLIES 7

@BhagyaK58374570 

you will have to debug it

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

hi @BhagyaK58374570 

 

you can use a Business Rule or Data Policy since ACLs may not fully address integration-based updates. Create Before Update Business Rule with following sample script and test once:

(function executeRule(current, previous /*null when async*/) {
    // Check if the current user is 'guest'
    if (gs.getUserName() == 'guest') {
        gs.addErrorMessage("Updates to wm_task by Guest user are not allowed.");
        current.setAbortAction(true); // Abort the update
    }
})(current, previous);

 

If the integration updates are bypassing Business Rules or you want a more declarative approach, you can use a Data Policy to enforce restrictions. with condition as, field (sys_updated_by) is (guest). Action set to Read-Only or use a script to reject the update.

 

Thanks

Rajesh

 

 

shantanu_patel8
Mega Guru

Hi @BhagyaK58374570 ,

 

My suggestion would be to check for the source of the update as it will help you understand the issue and then you can work towards fixing it. 

 

Check for the received emails from the email logs to see if the source is inbound actions since the update is by Guest.

 

Please mark the answer helpful clicking on 👍 and correct if it helps the issue. Happy scripting 🙂

 

-Shantanu