Browse Source

publish muk_security - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
541cab2a38
  1. 2
      muk_security/__manifest__.py
  2. 2
      muk_security/models/base.py
  3. 16
      muk_security/models/mixins_access_rights.py

2
muk_security/__manifest__.py

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

2
muk_security/models/base.py

@ -46,7 +46,7 @@ class Base(models.AbstractModel):
@api.multi
def _filter_access_ids(self, operation):
return self._filter_access_rules(operation).ids
return self._filter_access(operation).ids
@api.model
def _apply_ir_rules(self, query, mode='read'):

16
muk_security/models/mixins_access_rights.py

@ -61,26 +61,26 @@ class AccessModel(models.AbstractModel):
@api.model
def _search_permission_read(self, operator, operand):
if operator == '=' and operand:
return [('id', 'in', self._filter_access_ids('read'))]
return [('id', 'not in', self._filter_access_ids('read'))]
return [('id', 'in', self.search([])._filter_access_ids('read'))]
return [('id', 'not in', self.search([])._filter_access_ids('read'))]
@api.model
def _search_permission_create(self, operator, operand):
if operator == '=' and operand:
return [('id', 'in', self._filter_access_ids('create'))]
return [('id', 'not in', self._filter_access_ids('create'))]
return [('id', 'in', self.search([])._filter_access_ids('create'))]
return [('id', 'not in', self.search([])._filter_access_ids('create'))]
@api.model
def _search_permission_write(self, operator, operand):
if operator == '=' and operand:
return [('id', 'in', self._filter_access_ids('write'))]
return [('id', 'not in', self._filter_access_ids('write'))]
return [('id', 'in', self.search([])._filter_access_ids('write'))]
return [('id', 'not in', self.search([])._filter_access_ids('write'))]
@api.model
def _search_permission_unlink(self, operator, operand):
if operator == '=' and operand:
return [('id', 'in', self._filter_access_ids('unlink'))]
return [('id', 'not in', self._filter_access_ids('unlink'))]
return [('id', 'in', self.search([])._filter_access_ids('unlink'))]
return [('id', 'not in', self.search([])._filter_access_ids('unlink'))]
#----------------------------------------------------------
# Read, View

Loading…
Cancel
Save