brotherton-erpnext/patches/january_2013/remove_bad_permissions.py
2013-11-20 13:00:28 +05:30

10 lines
415 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.conn.sql("""update tabDocPerm set permlevel=0 where permlevel is null""")
webnotes.conn.sql("""update tabDocPerm set `create`=0, `submit`=0, `cancel`=0,
`amend`=0, `match`='' where permlevel>0""")
webnotes.delete_doc("Permission Control")