mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-23 13:31:58 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04ca3f5661 | ||
|
|
5d84b08e26 |
@@ -8,6 +8,11 @@
|
||||
Changes
|
||||
=======
|
||||
|
||||
Version v0.12.5 (release 2024-07-29)
|
||||
|
||||
- fix: permission for ip
|
||||
|
||||
|
||||
Version v0.12.3 (release 2024-07-25)
|
||||
|
||||
- fix(tugraz_authenticated): missmatch of role name
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
from .ext import InvenioConfigTugraz
|
||||
from .utils import get_identity_from_user_by_email
|
||||
|
||||
__version__ = "0.12.3"
|
||||
__version__ = "0.12.5"
|
||||
|
||||
__all__ = (
|
||||
"__version__",
|
||||
|
||||
@@ -65,12 +65,11 @@ class RecordSingleIP(Generator):
|
||||
if record is None:
|
||||
return []
|
||||
|
||||
# if record does not have singleip - return any_user
|
||||
if not record.get("custom_fields", {}).get("single_ip", False):
|
||||
return [any_user]
|
||||
|
||||
# if record has singleip, and the ip of the user matches the allowed ip
|
||||
if self.check_permission():
|
||||
if (
|
||||
record.get("custom_fields", {}).get("single_ip", False)
|
||||
and self.check_permission()
|
||||
):
|
||||
return [any_user]
|
||||
|
||||
# non of the above - return empty
|
||||
@@ -138,12 +137,11 @@ class AllowedFromIPNetwork(Generator):
|
||||
if record is None:
|
||||
return []
|
||||
|
||||
# if the record doesn't have set the ip range allowance
|
||||
if not record.get("custom_fields", {}).get("ip_network", False):
|
||||
return [any_user]
|
||||
|
||||
# if the record has set the ip_range allowance and is in the range
|
||||
if self.check_permission():
|
||||
if (
|
||||
record.get("custom_fields", {}).get("ip_network", False)
|
||||
and self.check_permission()
|
||||
):
|
||||
return [any_user]
|
||||
|
||||
# non of the above - return empty
|
||||
|
||||
Reference in New Issue
Block a user