Protection Policy is set to Read-Only

Ling2
Mega Contributor

Hi all,


Does anyone know how do I make the Script Includes editable after cloning?1111.png

If anyone knows how to set disable the protection policy to read-only, please let me know.

Thank you.

5 REPLIES 5

Thijs Daemen
Mega Guru

Hi,



You cannot access this yourself, you'll need ServiceNow to change it for you. Assuming it's not part of a scoped app and you should have access to it. So as long as you created it yourself and something went wrong with the clone or the creation of the record, they should be able to unlock it for you.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Tiff,



Some application code shipped with the ServiceNow system requires special protection. When an application file has a Read-only protection policy, nobody can modify the related record.


Only a ServiceNow employee can alter the protection policy and then modify the application file or its related record. A ServiceNow employee cannot make any changes without changing the policy designation first.


Alex Ng
Tera Contributor

Hi all,



Looking at your replies, if this kind of issue happens in a scoped application, can I just raise a request in HI to seek ServiceNow employee to help unlock the protection policy? Is this possible or the protection policy has been locked forever in the scoped application?



Anyone experience this before?



Thank you.


PriyaRanji
Tera Guru

Hi Ling,

Good Day!

Please do write the fix script with below mentioned script and run the same, it should work 🙂

var gr = new GlideRecord('sys_script_include');
if (gr.get('add sys id of script include')) {
    gr.sys_policy = ''; //remove protection
    gr.update();
gr.deleteRecord(); --> add this line if you want to delete the record else you can set the value as empty


Thanks,
Priyanka R