Browse Source

publish muk_security - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
9f510e491e
  1. 2
      muk_security/__manifest__.py
  2. 23
      muk_security/models/base.py

2
muk_security/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Security",
"summary": """Security Features""",
"version": "12.0.1.5.0",
"version": "12.0.1.5.1",
"category": "Extra Tools",
"license": "AGPL-3",
"website": "http://www.mukit.at",

23
muk_security/models/base.py

@ -38,16 +38,6 @@ class Base(models.AbstractModel):
return self
return super(Base, self)._filter_access_rules(operation)
@api.multi
def _filter_access(self, operation):
if self.check_access_rights('read', False):
return self._filter_access_rules(operation)
return self.env[self._name]
@api.multi
def _filter_access_ids(self, operation):
return self._filter_access(operation).ids
@api.model
def _apply_ir_rules(self, query, mode='read'):
if isinstance(self.env.uid, NoSecurityUid):
@ -72,15 +62,4 @@ class Base(models.AbstractModel):
def check_field_access_rights(self, operation, fields):
if isinstance(self.env.uid, NoSecurityUid):
return fields or list(self._fields)
return super(Base, self).check_field_access_rights(operation, fields)
@api.multi
def check_access(self, operation, raise_exception=False):
try:
access_right = self.check_access_rights(operation, raise_exception)
access_rule = self.check_access_rule(operation) is None
return access_right and access_rule
except AccessError:
if raise_exception:
raise
return False
return super(Base, self).check_field_access_rights(operation, fields)
Loading…
Cancel
Save