Merge pull request #5289 from expsa/maz_base_simplify

fix
This commit is contained in:
mazenmuhamad 2025-11-09 12:18:32 +02:00 committed by GitHub
commit ca1573ad50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ class ir_model_access(models.Model):
# User root have all accesses # User root have all accesses
return True return True
# Handle auth='none' API endpoints with sudo() - Fix for mobile API access
if not self._uid:
return True
assert isinstance(model, str), 'Not a model name: %s' % (model,) assert isinstance(model, str), 'Not a model name: %s' % (model,)
assert mode in ('read', 'write', 'create', 'unlink'), 'Invalid access mode' assert mode in ('read', 'write', 'create', 'unlink'), 'Invalid access mode'