class MailGW(mailgw.MailGW): ''' derives basic mail gateway implementation from the standard module, with any specific extensions ''' def hasPermissions(self, author, classname, nodeid): return (mailgw.MailGW.hasPermissions(self, author, classname, nodeid) or (self.db.security.hasPermission('CreateOrReplyToSelf', author, classname) and nodeid is None) or (self.db.security.hasPermission('CreateOrReplyToSelf', author, classname) and replyingToSelf(self.db, classname, nodeid, author))) def replyingToSelf(db, classname, nodeid, userid): node = db.getnode(classname, nodeid) return node['creator'] == userid