mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
[knowledge base] removed and added patch to move to notes
This commit is contained in:
@@ -8,12 +8,13 @@ class DocType:
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def onload(self):
|
||||
if webnotes.session.user != self.doc.owner:
|
||||
if not self.doc.public and webnotes.session.user != self.doc.owner:
|
||||
if webnotes.session.user not in [d.user for d in self.doclist if d.doctype=="Note User"]:
|
||||
webnotes.msgprint("You are not authorized to read this record.", raise_exception=True)
|
||||
|
||||
def validate(self):
|
||||
if webnotes.session.user != self.doc.owner:
|
||||
if webnotes.session.user not in webnotes.conn.sql_list("""select user from `tabNote User`
|
||||
where parent=%s and permission='Edit'""", self.doc.name):
|
||||
webnotes.msgprint("You are not authorized to edit this record.", raise_exception=True)
|
||||
if not self.doc.fields.get("__islocal"):
|
||||
if webnotes.session.user != self.doc.owner:
|
||||
if webnotes.session.user not in webnotes.conn.sql_list("""select user from `tabNote User`
|
||||
where parent=%s and permission='Edit'""", self.doc.name):
|
||||
webnotes.msgprint("You are not authorized to edit this record.", raise_exception=True)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-24 13:41:00",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-05-24 15:47:11",
|
||||
"modified": "2013-05-24 16:24:02",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -62,6 +62,13 @@
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Share"
|
||||
},
|
||||
{
|
||||
"description": "Everyone can read",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "public",
|
||||
"fieldtype": "Check",
|
||||
"label": "Public"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "share_with",
|
||||
|
||||
Reference in New Issue
Block a user