Browse Source

publish muk_security - 11.0

pull/16/head
MuK IT GmbH 6 years ago
parent
commit
18afd05542
  1. 2
      muk_security/__manifest__.py
  2. 2
      muk_security/models/res_users.py
  3. 70
      muk_security/tools/helper.py

2
muk_security/__manifest__.py

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

2
muk_security/models/res_users.py

@ -54,4 +54,4 @@ class AccessUser(models.Model):
return super(AccessUser, cls)._browse([
id if not isinstance(id, helper.NoSecurityUid)
else super(helper.NoSecurityUid, id).__int__()
for id in ids], env, prefetch=prefetch)
for id in ids], env, prefetch=prefetch)

70
muk_security/tools/helper.py

@ -1,36 +1,36 @@
###################################################################################
#
# MuK Document Management System
#
# Copyright (C) 2018 MuK IT GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
class NoSecurityUid(int):
def __int__(self):
return self
def __eq__(self, other):
if isinstance(other, int):
return False
return super(NoSecurityUid, self).__int__() == other
def __iter__(self):
yield super(NoSecurityUid, self).__int__()
def __hash__(self):
###################################################################################
#
# MuK Document Management System
#
# Copyright (C) 2018 MuK IT GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
class NoSecurityUid(int):
def __int__(self):
return self
def __eq__(self, other):
if isinstance(other, int):
return False
return super(NoSecurityUid, self).__int__() == other
def __iter__(self):
yield super(NoSecurityUid, self).__int__()
def __hash__(self):
return super(NoSecurityUid, self).__hash__()
Loading…
Cancel
Save