Workset Editability

I used this code in my script and edited to non editable and it doesn’t seem to work for me, can anyone help