make server side custom script readonly for system manager
This commit is contained in:
parent
8db7ff3b36
commit
6420e602e0
30
erpnext/patches/may_2012/cs_server_readonly.py
Normal file
30
erpnext/patches/may_2012/cs_server_readonly.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
def execute():
|
||||||
|
"""Make server custom script readonly for system manager"""
|
||||||
|
import webnotes.model.doc
|
||||||
|
new_perms = [
|
||||||
|
{
|
||||||
|
'parent': 'Custom Script',
|
||||||
|
'parentfield': 'permissions',
|
||||||
|
'parenttype': 'DocType',
|
||||||
|
'role': 'System Manager',
|
||||||
|
'permlevel': 1,
|
||||||
|
'read': 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'parent': 'Custom Script',
|
||||||
|
'parentfield': 'permissions',
|
||||||
|
'parenttype': 'DocType',
|
||||||
|
'role': 'Administrator',
|
||||||
|
'permlevel': 1,
|
||||||
|
'read': 1,
|
||||||
|
'write': 1
|
||||||
|
},
|
||||||
|
]
|
||||||
|
for perms in new_perms:
|
||||||
|
doc = webnotes.model.doc.Document('DocPerm')
|
||||||
|
doc.fields.update(perms)
|
||||||
|
doc.save()
|
||||||
|
webnotes.conn.commit()
|
||||||
|
webnotes.conn.begin()
|
||||||
|
import webnotes.model.sync
|
||||||
|
webnotes.model.sync.sync('core', 'custom_script')
|
@ -372,5 +372,10 @@ patch_list = [
|
|||||||
'patch_file': 'customize_form_cleanup',
|
'patch_file': 'customize_form_cleanup',
|
||||||
'description': 'cleanup customize form records'
|
'description': 'cleanup customize form records'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'patch_module': 'patches.may_2012',
|
||||||
|
'patch_file': 'cs_server_readonly',
|
||||||
|
'description': 'Make server custom script readonly for system manager'
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user