[permission model] Redesign

Conflicts:

	patches/patch_list.py
This commit is contained in:
Rushabh Mehta
2013-11-26 17:54:53 +05:30
committed by Anand Doshi
parent 74f64b67db
commit 497d363fc1
10 changed files with 60 additions and 11 deletions

View File

@@ -43,9 +43,11 @@ class DocType:
self.update_profile()
def update_user_default(self):
if not "HR User" in webnotes.local.user.get_roles():
webnotes.conn.set_default("Employee", self.doc.name, self.doc.user_id, "Restriction")
webnotes.conn.set_default("employee", self.doc.name, self.doc.user_id)
webnotes.conn.set_default("employee_name", self.doc.employee_name, self.doc.user_id)
webnotes.conn.set_default("company", self.doc.company, self.doc.user_id)
self.set_default_leave_approver()
def set_default_leave_approver(self):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 09:04:18",
"docstatus": 0,
"modified": "2013-11-03 11:19:10",
"modified": "2013-11-26 16:36:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -415,6 +415,7 @@
"doctype": "DocField",
"fieldname": "reports_to",
"fieldtype": "Link",
"ignore_restriction": 1,
"label": "Reports to",
"oldfieldname": "reports_to",
"oldfieldtype": "Link",
@@ -749,7 +750,6 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"match": "employee",
"role": "Employee",
"write": 0
},
@@ -757,7 +757,6 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"match": "company",
"role": "HR User",
"write": 1
},