From 2aa5d026d1b2c562fef370c37604a7378788b4a3 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 23 Nov 2010 20:49:38 +0200 Subject: [PATCH] document: fix access of res.users folders We need to relax the rule of ir.attachment. Needs server patch, see commit message there. bzr revid: p_christ@hol.gr-20101123184938-jklijdqt0xx5u6cs --- addons/document/document.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/document/document.py b/addons/document/document.py index e3d810668b4..790b650d4f5 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -133,6 +133,15 @@ class document_file(osv.osv): return False return True + def check(self, cr, uid, ids, mode, context=None, values=None): + """Check access wrt. res_model, relax the rule of ir.attachment parent + + With 'document' installed, everybody will have access to attachments of + any resources they can *read*. + """ + return super(document_file, self).check(cr, uid, ids, mode='read', + context=context, values=values) + def copy(self, cr, uid, id, default=None, context=None): if not default: default = {}