oarepo-runtime 1.5.96__tar.gz → 1.5.98__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oarepo_runtime-1.5.96/oarepo_runtime.egg-info → oarepo_runtime-1.5.98}/PKG-INFO +1 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/ext.py +1 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/permissions_presets.py +14 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/mappings.py +3 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/params.py +62 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/search.py +27 -5
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98/oarepo_runtime.egg-info}/PKG-INFO +1 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/setup.cfg +1 -1
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/LICENSE +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/MANIFEST.in +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/README.md +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/assets.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/base.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/cf.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/check.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/configuration.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/fixtures.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/index.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/validate.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/asynchronous.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/catalogue.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/datastreams.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/errors.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/ext.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/fixtures.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/json.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/attachments.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/excel.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/json.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/yaml.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/semi_asynchronous.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/synchronous.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/transformers.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/types.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/utils.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/attachments_file.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/attachments_service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/utils.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/validation_errors.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/yaml.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/ext_config.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/i18n/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/info/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/info/check.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/info/views.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/profile.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/proxies.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/edtf_interval.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/multilingual_dumper.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/proxies.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/mappings/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/mappings/rdm_parent_mapping.json +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/owners/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/owners/registry.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/base.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/internal.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/lookup.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/pid_relation.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/featured_file.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/has_draftcheck.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/icu.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/mapping.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/owner.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/record_status.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/selectors.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/synthetic.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/file_resource.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/json_serializer.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/localized_ui_json_serializer.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/components.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/link_conditions.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/config.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/schema.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/expandable_fields.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/base.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/date.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/enum.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/facet_groups_names.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/max_facet.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/nested_facet.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/year_histogram.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/components.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/service.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/generators.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/generators.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/records/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/records/links.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/components.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/errors.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/mapping.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/results.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/cf.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n_ui.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n_validation.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/marshmallow.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/marshmallow_to_json_schema.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/oneofschema.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/polymorphic.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/rdm.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/ui.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/validation.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/tasks.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/cs/LC_MESSAGES/messages.po +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/default_translations.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/en/LC_MESSAGES/messages.mo +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/en/LC_MESSAGES/messages.po +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/messages.pot +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/uow.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/functools.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/path.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/SOURCES.txt +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/dependency_links.txt +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/entry_points.txt +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/requires.txt +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/top_level.txt +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/pyproject.toml +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/setup.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/__init__.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_datacite_ui_schema.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_simple_schema.py +0 -0
- {oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/pkg_data/__init__.py +0 -0
@@ -33,7 +33,7 @@ class OARepoRuntime(object):
|
|
33
33
|
@cached_property
|
34
34
|
def rdm_excluded_components(self):
|
35
35
|
return [
|
36
|
-
obj_or_import_string(x) for x in self.app.config.get("
|
36
|
+
obj_or_import_string(x) for x in self.app.config.get("RDM_EXCLUDED_COMPONENTS", [])
|
37
37
|
]
|
38
38
|
|
39
39
|
def init_config(self, app):
|
@@ -80,6 +80,11 @@ class ReadOnlyPermissionPolicy(RecordPermissionPolicy):
|
|
80
80
|
can_add_community = [SystemProcess()]
|
81
81
|
can_remove_community = [SystemProcess()]
|
82
82
|
|
83
|
+
can_read_deleted = [SystemProcess()]
|
84
|
+
can_manage_record_access = [SystemProcess()]
|
85
|
+
can_lift_embargo = [SystemProcess()]
|
86
|
+
|
87
|
+
|
83
88
|
|
84
89
|
class EveryonePermissionPolicy(RecordPermissionPolicy):
|
85
90
|
"""record policy for read only repository"""
|
@@ -119,12 +124,17 @@ class EveryonePermissionPolicy(RecordPermissionPolicy):
|
|
119
124
|
can_add_community = [SystemProcess(), AnyUser()]
|
120
125
|
can_remove_community = [SystemProcess(), AnyUser()]
|
121
126
|
|
127
|
+
can_read_deleted = [SystemProcess(), AnyUser()]
|
128
|
+
can_manage_record_access = [SystemProcess(), AnyUser()]
|
129
|
+
can_lift_embargo = [SystemProcess(), AnyUser()]
|
130
|
+
|
122
131
|
|
123
132
|
class AuthenticatedPermissionPolicy(RecordPermissionPolicy):
|
124
133
|
"""record policy for read only repository"""
|
125
134
|
|
126
135
|
can_search = [SystemProcess(), AuthenticatedUser()]
|
127
136
|
can_read = [SystemProcess(), AnyUser()]
|
137
|
+
can_read_deleted = [SystemProcess(), AnyUser()]
|
128
138
|
can_create = [SystemProcess(), AuthenticatedUser()]
|
129
139
|
can_update = [SystemProcess(), AuthenticatedUser()]
|
130
140
|
can_delete = [SystemProcess(), AuthenticatedUser()]
|
@@ -136,7 +146,6 @@ class AuthenticatedPermissionPolicy(RecordPermissionPolicy):
|
|
136
146
|
can_commit_files = [SystemProcess(), AuthenticatedUser()]
|
137
147
|
can_read_files = [SystemProcess(), AnyUser()]
|
138
148
|
can_update_files = [SystemProcess(), AuthenticatedUser()]
|
139
|
-
can_delete_files = [SystemProcess(), AuthenticatedUser()]
|
140
149
|
can_list_files = [SystemProcess(), AuthenticatedUser()]
|
141
150
|
can_manage_files = [SystemProcess(), AuthenticatedUser()]
|
142
151
|
|
@@ -157,3 +166,7 @@ class AuthenticatedPermissionPolicy(RecordPermissionPolicy):
|
|
157
166
|
|
158
167
|
can_add_community = [SystemProcess(), AuthenticatedUser()]
|
159
168
|
can_remove_community = [SystemProcess(), AuthenticatedUser()]
|
169
|
+
|
170
|
+
can_delete_files = [SystemProcess(), AuthenticatedUser()]
|
171
|
+
can_manage_record_access = [SystemProcess(), AuthenticatedUser()]
|
172
|
+
can_lift_embargo = [SystemProcess(), AuthenticatedUser()]
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/mappings.py
RENAMED
@@ -121,6 +121,9 @@ def prepare_parent_mapping(parent_class, config):
|
|
121
121
|
if not parent_class:
|
122
122
|
return
|
123
123
|
|
124
|
+
if not config.record_cls.index._name:
|
125
|
+
return
|
126
|
+
|
124
127
|
script_dir = str(Path(__file__).resolve().parent)
|
125
128
|
path_parts = script_dir.split('/')
|
126
129
|
path_parts = path_parts[:-2]
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import copy
|
2
2
|
import logging
|
3
|
+
import operator
|
4
|
+
from functools import partial, reduce
|
3
5
|
from typing import List
|
4
6
|
|
5
7
|
from flask import current_app
|
@@ -8,6 +10,12 @@ from invenio_access.permissions import system_user_id
|
|
8
10
|
from invenio_app.helpers import obj_or_import_string
|
9
11
|
from invenio_records_resources.services.records.facets import FacetsResponse
|
10
12
|
from invenio_records_resources.services.records.params import FacetsParam
|
13
|
+
from invenio_access.permissions import authenticated_user
|
14
|
+
from invenio_records_resources.services.records.params.base import ParamInterpreter
|
15
|
+
from invenio_search.engine import dsl
|
16
|
+
from invenio_rdm_records.records.systemfields.deletion_status import (
|
17
|
+
RecordDeletionStatusEnum,
|
18
|
+
)
|
11
19
|
|
12
20
|
log = logging.getLogger(__name__)
|
13
21
|
|
@@ -96,7 +104,7 @@ class GroupedFacetsParam(FacetsParam):
|
|
96
104
|
for f in filters[1:]:
|
97
105
|
_filter &= f
|
98
106
|
|
99
|
-
return search.filter(_filter)
|
107
|
+
return search.filter(_filter).post_filter(_filter)
|
100
108
|
|
101
109
|
def apply(self, identity, search, params):
|
102
110
|
"""Evaluate the facets on the search."""
|
@@ -129,3 +137,56 @@ class GroupedFacetsParam(FacetsParam):
|
|
129
137
|
for group in groups:
|
130
138
|
user_facets.update(self.facet_groups.get(group, {}))
|
131
139
|
return user_facets
|
140
|
+
|
141
|
+
|
142
|
+
class OARepoAllVersionsParam(ParamInterpreter):
|
143
|
+
"""Evaluates the 'allversions' parameter."""
|
144
|
+
def __init__(self, field_names, config):
|
145
|
+
"""Construct."""
|
146
|
+
self.field_names = field_names
|
147
|
+
super().__init__(config)
|
148
|
+
|
149
|
+
@classmethod
|
150
|
+
def factory(cls, field_names: list[str]):
|
151
|
+
"""Create a new filter parameter."""
|
152
|
+
return partial(cls, field_names)
|
153
|
+
|
154
|
+
def apply(self, identity, search, params):
|
155
|
+
"""Evaluate the allversions parameter on the search."""
|
156
|
+
if not params.get("allversions"):
|
157
|
+
queries = [dsl.query.Q("term", **{field_name: True}) for field_name in self.field_names]
|
158
|
+
query = reduce(operator.or_, queries)
|
159
|
+
search = search.filter(query)
|
160
|
+
return search
|
161
|
+
|
162
|
+
class OARepoPublishedRecordsParam(ParamInterpreter):
|
163
|
+
"""Evaluates the include_deleted parameter."""
|
164
|
+
|
165
|
+
def apply(self, identity, search, params):
|
166
|
+
"""Evaluate the include_deleted parameter on the search."""
|
167
|
+
|
168
|
+
value = params.pop("include_deleted", None)
|
169
|
+
# Filter prevents from displaying deleted records on mainsite search
|
170
|
+
# deleted records should appear only in admins panel
|
171
|
+
if value is None:
|
172
|
+
query = dsl.query.Q(
|
173
|
+
"bool",
|
174
|
+
should=[
|
175
|
+
dsl.query.Q(
|
176
|
+
"bool",
|
177
|
+
must=[
|
178
|
+
dsl.query.Q(
|
179
|
+
"term",
|
180
|
+
deletion_status=RecordDeletionStatusEnum.PUBLISHED.value,
|
181
|
+
)
|
182
|
+
],
|
183
|
+
),
|
184
|
+
# Drafts does not have deletion_status so this clause is needed to
|
185
|
+
# prevent the above clause from filtering out the drafts
|
186
|
+
dsl.query.Q(
|
187
|
+
"bool", must_not=[dsl.query.Q("exists", field="deletion_status")]
|
188
|
+
),
|
189
|
+
],
|
190
|
+
)
|
191
|
+
search = search.filter(query)
|
192
|
+
return search
|
@@ -10,6 +10,7 @@ from invenio_records_resources.proxies import current_service_registry
|
|
10
10
|
from invenio_records_resources.services.records import (
|
11
11
|
SearchOptions as InvenioSearchOptions,
|
12
12
|
)
|
13
|
+
from invenio_drafts_resources.services.records.config import SearchDraftsOptions as InvenioSearchDraftsOptions
|
13
14
|
from invenio_records_resources.services.records.params import (
|
14
15
|
FacetsParam,
|
15
16
|
PaginationParam,
|
@@ -18,14 +19,16 @@ from invenio_records_resources.services.records.params import (
|
|
18
19
|
)
|
19
20
|
from invenio_records_resources.services.records.queryparser import SuggestQueryParser
|
20
21
|
from invenio_search.engine import dsl
|
21
|
-
|
22
|
+
from invenio_drafts_resources.services.records.search_params import AllVersionsParam
|
22
23
|
# TODO: integrate this to invenio_records_resources.services.records and remove SearchOptions class
|
23
24
|
from oarepo_runtime.i18n import lazy_gettext as _
|
24
25
|
from oarepo_runtime.records.systemfields.icu import ICUSuggestField
|
25
26
|
from oarepo_runtime.utils.functools import class_property
|
26
27
|
|
27
|
-
from .facets.params import GroupedFacetsParam
|
28
|
-
|
28
|
+
from .facets.params import GroupedFacetsParam, OARepoAllVersionsParam, OARepoPublishedRecordsParam
|
29
|
+
from invenio_drafts_resources.services.records.search_params import AllVersionsParam
|
30
|
+
from invenio_rdm_records.services.search_params import PublishedRecordsParam
|
31
|
+
from functools import partial
|
29
32
|
try:
|
30
33
|
from invenio_i18n import get_locale
|
31
34
|
except ImportError:
|
@@ -57,11 +60,19 @@ class SearchOptionsMixin:
|
|
57
60
|
@class_property
|
58
61
|
def params_interpreters_cls(cls):
|
59
62
|
"""Replaces FacetsParam with GroupedFacetsParam."""
|
63
|
+
params_replace_map = {FacetsParam: GroupedFacetsParam, AllVersionsParam:
|
64
|
+
OARepoAllVersionsParam.factory(["versions.is_latest", "versions.is_latest_draft"]),
|
65
|
+
PublishedRecordsParam: OARepoPublishedRecordsParam}
|
66
|
+
|
60
67
|
param_interpreters = [*super(SearchOptionsMixin, cls).params_interpreters_cls]
|
61
68
|
# replace FacetsParam with GroupedFacetsParam
|
62
69
|
for idx, interpreter in enumerate(param_interpreters):
|
63
|
-
if interpreter
|
64
|
-
param_interpreters[idx] =
|
70
|
+
if interpreter in params_replace_map:
|
71
|
+
param_interpreters[idx] = params_replace_map[interpreter]
|
72
|
+
elif isinstance(interpreter, partial):
|
73
|
+
fn = interpreter.func
|
74
|
+
if fn in params_replace_map:
|
75
|
+
param_interpreters[idx] = params_replace_map[fn]
|
65
76
|
return param_interpreters
|
66
77
|
|
67
78
|
sort_options = {
|
@@ -113,6 +124,7 @@ class SearchOptionsDraftMixin(SearchOptionsMixin):
|
|
113
124
|
}
|
114
125
|
|
115
126
|
|
127
|
+
|
116
128
|
class SearchOptions(SearchOptionsMixin, InvenioSearchOptions):
|
117
129
|
# TODO: should be changed
|
118
130
|
params_interpreters_cls = [
|
@@ -122,6 +134,16 @@ class SearchOptions(SearchOptionsMixin, InvenioSearchOptions):
|
|
122
134
|
GroupedFacetsParam,
|
123
135
|
]
|
124
136
|
|
137
|
+
class SearchDraftsOptions(SearchOptionsMixin, InvenioSearchDraftsOptions):
|
138
|
+
# TODO: should be changed
|
139
|
+
params_interpreters_cls = [
|
140
|
+
QueryStrParam,
|
141
|
+
PaginationParam,
|
142
|
+
SortParam,
|
143
|
+
GroupedFacetsParam,
|
144
|
+
AllVersionsParam.factory("versions.is_latest_draft")
|
145
|
+
]
|
146
|
+
|
125
147
|
|
126
148
|
class RDMSearchOptions(SearchOptionsMixin, BaseRDMSearchOptions):
|
127
149
|
pass
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/attachments.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/service.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/semi_asynchronous.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/edtf_interval.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/proxies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/__init__.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/internal.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/pid_relation.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/featured_file.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/mapping.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/owner.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/record_status.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/selectors.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/synthetic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/link_conditions.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/__init__.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/facet_groups_names.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/nested_facet.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/year_histogram.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/generators.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/components.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/mapping.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n_validation.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/marshmallow.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/oneofschema.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/polymorphic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/validation.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/default_translations.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_datacite_ui_schema.py
RENAMED
File without changes
|
{oarepo_runtime-1.5.96 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_simple_schema.py
RENAMED
File without changes
|
File without changes
|