~openerp-community/openobject-server/fix-1130010-toxml-escape-quot

« back to all changes in this revision

Viewing changes to openerp/osv/orm.py

  • Committer: niv-openerp
  • Date: 2013-06-10 15:06:57 UTC
  • mfrom: (4867.1.15 saas-1)
  • Revision ID: nicolas.vanhoren@openerp.com-20130610150657-3xddn91gm0iq0ubp
[MERGE] saas1 branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
3857
3857
            # Attempt to distinguish record rule restriction vs deleted records,
3858
3858
            # to provide a more specific error message - check if the missinf
3859
3859
            cr.execute('SELECT id FROM ' + self._table + ' WHERE id IN %s', (tuple(missing_ids),))
3860
 
            if cr.rowcount:
 
3860
            forbidden_ids = [x[0] for x in cr.fetchall()]
 
3861
            if forbidden_ids:
3861
3862
                # the missing ids are (at least partially) hidden by access rules
3862
3863
                if uid == SUPERUSER_ID:
3863
3864
                    return
3864
 
                _logger.warning('Access Denied by record rules for operation: %s, uid: %s, model: %s', operation, uid, self._name)
 
3865
                _logger.warning('Access Denied by record rules for operation: %s on record ids: %r, uid: %s, model: %s', operation, forbidden_ids, uid, self._name)
3865
3866
                raise except_orm(_('Access Denied'),
3866
3867
                                 _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \
3867
3868
                                    (self._description, operation))