diff --git a/muk_security/__manifest__.py b/muk_security/__manifest__.py index f08205b..65aa631 100644 --- a/muk_security/__manifest__.py +++ b/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", diff --git a/muk_security/models/base.py b/muk_security/models/base.py index 2e575ed..ea6f965 100644 --- a/muk_security/models/base.py +++ b/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'): diff --git a/muk_security/models/mixins_access_rights.py b/muk_security/models/mixins_access_rights.py index e93711c..2e2a0a4 100644 --- a/muk_security/models/mixins_access_rights.py +++ b/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