- read:
- raise if the type is comment and subtype NULL (internal note)
"""
- group_ids = self.pool.get('res.users').browse(cr, uid, uid, context=context).groups_id
- group_user_id = self.pool.get("ir.model.data").get_object_reference(cr, uid, 'base', 'group_public')[1]
- if group_user_id in [group.id for group in group_ids]:
- cr.execute('SELECT id FROM "%s" WHERE website_published IS FALSE AND id = ANY (%%s)' % (self._table), (ids,))
- if cr.fetchall():
- raise osv.except_osv(
- _('Access Denied'),
- _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation))
-
+ if uid != SUPERUSER_ID:
+ group_ids = self.pool.get('res.users').browse(cr, uid, uid, context=context).groups_id
+ group_user_id = self.pool.get("ir.model.data").get_object_reference(cr, uid, 'base', 'group_public')[1]
+ if group_user_id in [group.id for group in group_ids]:
+ cr.execute('SELECT id FROM "%s" WHERE website_published IS FALSE AND id = ANY (%%s)' % (self._table), (ids,))
+ if cr.fetchall():
+ raise osv.except_osv(
+ _('Access Denied'),
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation))
return super(MailMessage, self).check_access_rule(cr, uid, ids=ids, operation=operation, context=context)