Browse Source

publish muk_security - 11.0

pull/6/head
MuK IT GmbH 6 years ago
parent
commit
77e76321b5
  1. 2
      muk_security/__manifest__.py
  2. 10
      muk_security/models/access_groups.py

2
muk_security/__manifest__.py

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

10
muk_security/models/access_groups.py

@ -123,7 +123,7 @@ class BaseModelAccessGroups(models.AbstractModel):
return groups
@api.model
def _get_no_access_ids(self):
def _get_no_access_ids(self, operation):
base, model = self._name.split(".")
if not self._strict_security:
sql = '''
@ -132,9 +132,9 @@ class BaseModelAccessGroups(models.AbstractModel):
WHERE NOT EXISTS (
SELECT *
FROM muk_groups_complete_%s_rel r
WHERE r.aid = a.id
WHERE r.aid = a.id AND perm_%s = true
);
''' % (self._table, model)
''' % (self._table, model, operation)
self.env.cr.execute(sql)
fetch = self.env.cr.fetchall()
return len(fetch) > 0 and list(map(lambda x: x[0], fetch)) or []
@ -170,14 +170,14 @@ class BaseModelAccessGroups(models.AbstractModel):
@api.model
def _get_ids_without_security(self, operation):
no_access_ids = self._get_no_access_ids()
no_access_ids = self._get_no_access_ids(operation)
suspended_access_ids = self._get_suspended_access_ids(operation)
return list(set(no_access_ids).union(suspended_access_ids))
@api.model
def _get_complete_access_ids(self, operation):
access_ids = self._get_access_ids()
no_access_ids = self._get_no_access_ids()
no_access_ids = self._get_no_access_ids(operation)
suspended_access_ids = self._get_suspended_access_ids(operation)
return list(set(access_ids).union(no_access_ids, suspended_access_ids))

Loading…
Cancel
Save