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 | |
|---|---|---|---|
|
|
8669f5dcda | ||
|
|
62256b346f |
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
|||||||
python-version: [3.8, 3.9]
|
python-version: [3.8, 3.9]
|
||||||
requirements-level: [pypi]
|
requirements-level: [pypi]
|
||||||
db-service: [postgresql13]
|
db-service: [postgresql13]
|
||||||
search-service: [elasticsearch7]
|
search-service: [opensearch2]
|
||||||
include:
|
include:
|
||||||
- db-service: postgresql13
|
- db-service: postgresql13
|
||||||
DB_EXTRAS: "postgresql"
|
DB_EXTRAS: "postgresql"
|
||||||
|
|
||||||
- search-service: elasticsearch7
|
- search-service: opensearch2
|
||||||
SEARCH_EXTRAS: "elasticsearch7"
|
SEARCH_EXTRAS: "opensearch2"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DB: ${{ matrix.db-service }}
|
DB: ${{ matrix.db-service }}
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
Version 0.10.0 (released 2022-10-13)
|
||||||
|
|
||||||
|
- global: migrate to v10 (#101)
|
||||||
|
|
||||||
Version 0.9.1 (released 2022-05-30)
|
Version 0.9.1 (released 2022-05-30)
|
||||||
|
|
||||||
- ci(publish): ping babel version (#99)
|
- ci(publish): ping babel version (#99)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ encoding = utf-8
|
|||||||
|
|
||||||
[jinja2: **/templates/**.*]
|
[jinja2: **/templates/**.*]
|
||||||
encoding = utf-8
|
encoding = utf-8
|
||||||
extensions = jinja2.ext.autoescape, jinja2.ext.with_
|
|
||||||
|
|
||||||
# Extraction from JavaScript files
|
# Extraction from JavaScript files
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ release = __version__
|
|||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = None
|
language = "en"
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
from .ext import InvenioConfigTugraz
|
from .ext import InvenioConfigTugraz
|
||||||
from .generators import RecordIp
|
from .generators import RecordIp
|
||||||
|
|
||||||
__version__ = "0.9.1"
|
__version__ = "0.10.0"
|
||||||
|
|
||||||
__all__ = ("__version__", "InvenioConfigTugraz", "RecordIp")
|
__all__ = ("__version__", "InvenioConfigTugraz", "RecordIp")
|
||||||
|
|||||||
@@ -151,10 +151,10 @@ The succinct encoding of the permissions for your instance gives you
|
|||||||
- great flexibility by defining your own actions, generators and policies
|
- great flexibility by defining your own actions, generators and policies
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from elasticsearch_dsl.query import Q
|
|
||||||
from flask import current_app, request
|
from flask import current_app, request
|
||||||
from invenio_access.permissions import any_user
|
from invenio_access.permissions import any_user
|
||||||
from invenio_records_permissions.generators import Generator
|
from invenio_records_permissions.generators import Generator
|
||||||
|
from invenio_search.engine import dsl
|
||||||
|
|
||||||
|
|
||||||
class RecordIp(Generator):
|
class RecordIp(Generator):
|
||||||
@@ -208,10 +208,10 @@ class RecordIp(Generator):
|
|||||||
|
|
||||||
if not visible:
|
if not visible:
|
||||||
# If user ip is not on the list, and If the record contains 'singleip' will not be seen
|
# If user ip is not on the list, and If the record contains 'singleip' will not be seen
|
||||||
return ~Q("match", **{"access.access_right": "singleip"})
|
return ~dsl.Q("match", **{"access.access_right": "singleip"})
|
||||||
|
|
||||||
# Lists all records
|
# Lists all records
|
||||||
return Q("match_all")
|
return dsl.Q("match_all")
|
||||||
|
|
||||||
def check_permission(self):
|
def check_permission(self):
|
||||||
"""Check for User IP address in config variable."""
|
"""Check for User IP address in config variable."""
|
||||||
|
|||||||
10
setup.cfg
10
setup.cfg
@@ -37,16 +37,18 @@ python_requires = >=3.8
|
|||||||
zip_safe = False
|
zip_safe = False
|
||||||
install_requires =
|
install_requires =
|
||||||
# keep this dependencies identical to invenio-app-rdm
|
# keep this dependencies identical to invenio-app-rdm
|
||||||
invenio-rdm-records>=0.35.16,<0.36.0
|
invenio-rdm-records>=0.39.0,<0.40.0
|
||||||
invenio-cache>=1.1.1,<1.2.0
|
invenio-cache>=1.1.1,<1.2.0
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
tests =
|
tests =
|
||||||
pytest-black>=0.3.0,<0.3.10
|
pytest-black>=0.3.0,<0.3.10
|
||||||
sphinx>=4.2.0,<5
|
Sphinx>=4.5.0
|
||||||
pytest-invenio>=1.4.7
|
pytest-invenio>=1.4.7
|
||||||
elasticsearch7 =
|
# elasticsearch7 =
|
||||||
invenio-search[elasticsearch7]>=1.4.2,<2.0
|
# invenio-search[elasticsearch7]>=2.1.0,<3.0.0
|
||||||
|
opensearch2 =
|
||||||
|
invenio-search[opensearch2]>=2.1.0,<3.0.0
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
invenio_base.apps =
|
invenio_base.apps =
|
||||||
|
|||||||
Reference in New Issue
Block a user