From 620145c59a494547d489d4f2b1e6950e6ec33112 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 16 Dec 2013 19:28:11 +0530 Subject: [PATCH] [minor] patches for restriction --- patches/1311/p08_restriction_management.py | 14 ++++++++++++++ patches/patch_list.py | 1 + 2 files changed, 15 insertions(+) create mode 100644 patches/1311/p08_restriction_management.py diff --git a/patches/1311/p08_restriction_management.py b/patches/1311/p08_restriction_management.py new file mode 100644 index 0000000000..e89d6d0a02 --- /dev/null +++ b/patches/1311/p08_restriction_management.py @@ -0,0 +1,14 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes + +def execute(): + # add role "Restriction Manager" + if not webnotes.conn.exists("Role", "Restriction Manager"): + webnotes.bean({"doctype": "Role", "role_name": "Restriction Manager"}).insert() + + # reset Page perms + from core.page.permission_manager.permission_manager import reset + reset("Page") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 6c6eb555f7..efc58538ff 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -264,4 +264,5 @@ patch_list = [ "patches.1311.p08_email_digest_recipients", "execute:webnotes.delete_doc('DocType', 'Warehouse Type')", "patches.1311.p07_move_warehouse_user_to_restrictions", + "patches.1311.p08_restriction_management", ] \ No newline at end of file