oarepo-runtime 1.5.97__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.
Files changed (150) hide show
  1. {oarepo_runtime-1.5.97/oarepo_runtime.egg-info → oarepo_runtime-1.5.98}/PKG-INFO +1 -1
  2. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/permissions_presets.py +14 -1
  3. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/mappings.py +3 -0
  4. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/params.py +62 -1
  5. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/search.py +27 -5
  6. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98/oarepo_runtime.egg-info}/PKG-INFO +1 -1
  7. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/setup.cfg +1 -1
  8. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/LICENSE +0 -0
  9. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/MANIFEST.in +0 -0
  10. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/README.md +0 -0
  11. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/__init__.py +0 -0
  12. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/__init__.py +0 -0
  13. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/assets.py +0 -0
  14. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/base.py +0 -0
  15. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/cf.py +0 -0
  16. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/check.py +0 -0
  17. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/configuration.py +0 -0
  18. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/fixtures.py +0 -0
  19. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/index.py +0 -0
  20. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/cli/validate.py +0 -0
  21. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/__init__.py +0 -0
  22. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/asynchronous.py +0 -0
  23. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/catalogue.py +0 -0
  24. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/datastreams.py +0 -0
  25. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/errors.py +0 -0
  26. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/ext.py +0 -0
  27. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/fixtures.py +0 -0
  28. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/json.py +0 -0
  29. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/__init__.py +0 -0
  30. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/attachments.py +0 -0
  31. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/excel.py +0 -0
  32. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/json.py +0 -0
  33. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/service.py +0 -0
  34. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/readers/yaml.py +0 -0
  35. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/semi_asynchronous.py +0 -0
  36. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/synchronous.py +0 -0
  37. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/transformers.py +0 -0
  38. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/types.py +0 -0
  39. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/utils.py +0 -0
  40. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/__init__.py +0 -0
  41. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/attachments_file.py +0 -0
  42. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/attachments_service.py +0 -0
  43. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/service.py +0 -0
  44. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/utils.py +0 -0
  45. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/validation_errors.py +0 -0
  46. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/datastreams/writers/yaml.py +0 -0
  47. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/ext.py +0 -0
  48. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/ext_config.py +0 -0
  49. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/i18n/__init__.py +0 -0
  50. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/info/__init__.py +0 -0
  51. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/info/check.py +0 -0
  52. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/info/views.py +0 -0
  53. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/profile.py +0 -0
  54. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/proxies.py +0 -0
  55. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/__init__.py +0 -0
  56. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/__init__.py +0 -0
  57. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/edtf_interval.py +0 -0
  58. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/dumpers/multilingual_dumper.py +0 -0
  59. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/__init__.py +0 -0
  60. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/entity_resolvers/proxies.py +0 -0
  61. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/mappings/__init__.py +0 -0
  62. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/mappings/rdm_parent_mapping.json +0 -0
  63. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/owners/__init__.py +0 -0
  64. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/owners/registry.py +0 -0
  65. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/__init__.py +0 -0
  66. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/base.py +0 -0
  67. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/internal.py +0 -0
  68. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/lookup.py +0 -0
  69. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/relations/pid_relation.py +0 -0
  70. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/__init__.py +0 -0
  71. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/featured_file.py +0 -0
  72. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/has_draftcheck.py +0 -0
  73. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/icu.py +0 -0
  74. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/mapping.py +0 -0
  75. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/owner.py +0 -0
  76. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/record_status.py +0 -0
  77. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/selectors.py +0 -0
  78. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/records/systemfields/synthetic.py +0 -0
  79. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/__init__.py +0 -0
  80. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/file_resource.py +0 -0
  81. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/json_serializer.py +0 -0
  82. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/resources/localized_ui_json_serializer.py +0 -0
  83. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/__init__.py +0 -0
  84. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/components.py +0 -0
  85. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/__init__.py +0 -0
  86. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/link_conditions.py +0 -0
  87. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/config/service.py +0 -0
  88. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/custom_fields/__init__.py +0 -0
  89. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/__init__.py +0 -0
  90. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/config.py +0 -0
  91. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/schema.py +0 -0
  92. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/entity/service.py +0 -0
  93. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/__init__.py +0 -0
  94. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/expandable_fields.py +0 -0
  95. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/expansions/service.py +0 -0
  96. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/__init__.py +0 -0
  97. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/base.py +0 -0
  98. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/date.py +0 -0
  99. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/enum.py +0 -0
  100. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/facet_groups_names.py +0 -0
  101. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/max_facet.py +0 -0
  102. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/nested_facet.py +0 -0
  103. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/facets/year_histogram.py +0 -0
  104. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/__init__.py +0 -0
  105. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/components.py +0 -0
  106. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/files/service.py +0 -0
  107. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/generators.py +0 -0
  108. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/__init__.py +0 -0
  109. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/permissions/generators.py +0 -0
  110. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/records/__init__.py +0 -0
  111. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/records/links.py +0 -0
  112. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/__init__.py +0 -0
  113. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/components.py +0 -0
  114. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/errors.py +0 -0
  115. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/relations/mapping.py +0 -0
  116. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/results.py +0 -0
  117. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/__init__.py +0 -0
  118. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/cf.py +0 -0
  119. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n.py +0 -0
  120. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n_ui.py +0 -0
  121. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/i18n_validation.py +0 -0
  122. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/marshmallow.py +0 -0
  123. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/marshmallow_to_json_schema.py +0 -0
  124. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/oneofschema.py +0 -0
  125. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/polymorphic.py +0 -0
  126. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/rdm.py +0 -0
  127. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/ui.py +0 -0
  128. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/services/schema/validation.py +0 -0
  129. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/tasks.py +0 -0
  130. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo +0 -0
  131. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/cs/LC_MESSAGES/messages.po +0 -0
  132. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/default_translations.py +0 -0
  133. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/en/LC_MESSAGES/messages.mo +0 -0
  134. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/en/LC_MESSAGES/messages.po +0 -0
  135. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/translations/messages.pot +0 -0
  136. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/uow.py +0 -0
  137. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/__init__.py +0 -0
  138. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/functools.py +0 -0
  139. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime/utils/path.py +0 -0
  140. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/SOURCES.txt +0 -0
  141. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/dependency_links.txt +0 -0
  142. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/entry_points.txt +0 -0
  143. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/requires.txt +0 -0
  144. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/oarepo_runtime.egg-info/top_level.txt +0 -0
  145. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/pyproject.toml +0 -0
  146. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/setup.py +0 -0
  147. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/__init__.py +0 -0
  148. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_datacite_ui_schema.py +0 -0
  149. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/tests/marshmallow_to_json/test_simple_schema.py +0 -0
  150. {oarepo_runtime-1.5.97 → oarepo_runtime-1.5.98}/tests/pkg_data/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.97
3
+ Version: 1.5.98
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -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()]
@@ -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 == FacetsParam:
64
- param_interpreters[idx] = GroupedFacetsParam
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.97
3
+ Version: 1.5.98
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = oarepo-runtime
3
- version = 1.5.97
3
+ version = 1.5.98
4
4
  description = A set of runtime extensions of Invenio repository
5
5
  authors = Alzbeta Pokorna
6
6
  readme = README.md
File without changes