[knowledge base] removed and added patch to move to notes

This commit is contained in:
Rushabh Mehta
2013-05-24 16:33:10 +05:30
parent 7e118cd875
commit 9c5f4fe165
48 changed files with 15 additions and 1289 deletions

View File

@@ -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)

View File

@@ -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",