elody 0.0.229__py3-none-any.whl → 0.0.231__py3-none-any.whl

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.
@@ -172,7 +172,7 @@ class BaseObjectConfiguration(ABC):
172
172
  ):
173
173
  if index == 0 and not any(info["object_list"] for info in keys_info):
174
174
  if value in ["ANY_MATCH", "NONE_MATCH"]:
175
- value = {"$exists": value == "ANY_MATCH"}
175
+ value = {"$nin" if value == "ANY_MATCH" else "$in": [None, ""]}
176
176
  matcher = {".".join(info["key"] for info in keys_info): value}
177
177
  if inner_exact_matches := kwargs.get("inner_exact_matches"):
178
178
  matcher.update(inner_exact_matches)
@@ -189,16 +189,11 @@ class BaseObjectConfiguration(ABC):
189
189
  ),
190
190
  }
191
191
  }
192
- if value in ["ANY_MATCH", "NONE_MATCH"]:
193
- elem_match_with_exists_operator = deepcopy(elem_match)
194
- del elem_match["$elemMatch"][keys_info[index + 1]["key"]]
195
- if value == "NONE_MATCH":
196
- return {
197
- "NOR_MATCHER": [
198
- {info["key"]: {"$all": [elem_match]}},
199
- {info["key"]: {"$all": [elem_match_with_exists_operator]}},
200
- ]
201
- }
192
+ if value == "NONE_MATCH":
193
+ elem_match["$elemMatch"][keys_info[index + 1]["key"]] = {
194
+ "$nin": [None, ""]
195
+ }
196
+ return {"NOR_MATCHER": [{info["key"]: {"$all": [elem_match]}}]}
202
197
  return elem_match if index > 0 else {info["key"]: {"$all": [elem_match]}}
203
198
 
204
199
  raise Exception(f"Unable to build nested matcher. See keys_info: {keys_info}")
@@ -296,7 +296,9 @@ def __is_allowed_to_crud_item_keys(
296
296
  restrictions = restrictions_schema.get("key_restrictions", {})
297
297
 
298
298
  for restricted_key, restricting_conditions in restrictions.items():
299
- restricted_key = restricted_key.split(":")[1]
299
+ restricted_key = (
300
+ restricted_key.split(":")[1].removeprefix("!").removeprefix("?")
301
+ )
300
302
  condition_match = True
301
303
  for condition_key, condition_values in restricting_conditions.items():
302
304
  condition_match = __item_value_in_values(
@@ -331,7 +333,8 @@ def __is_allowed_to_crud_item_keys(
331
333
  if key_to_check and key_to_check == restricted_key:
332
334
  user_context.bag["restricted_keys"].append(restricted_key)
333
335
  else:
334
- if flat_request_body.get(restricted_key) is not None:
336
+ value = flat_request_body.get(restricted_key)
337
+ if value is not None and value != flat_item.get(restricted_key):
335
338
  user_context.bag["restricted_keys"].append(restricted_key)
336
339
 
337
340
  user_context.bag["requested_item"] = item
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.229
3
+ Version: 0.0.231
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -12,13 +12,13 @@ elody/validator.py,sha256=G7Ya538EJHCFzOxEri2OcFMabfLBCtTKxuf4os_KuNw,260
12
12
  elody/migration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  elody/migration/base_object_migrator.py,sha256=n8uvgGfjEUy60G47RD7Y-oxp1vHLOauwPMDl87LcxtU,436
14
14
  elody/object_configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- elody/object_configurations/base_object_configuration.py,sha256=4lk6BmhRSYxwuD2qqGfE8d9H9ak7iwoOM5gqw7EntTI,7905
15
+ elody/object_configurations/base_object_configuration.py,sha256=DbH1l7Er52vSz2P4X1TsHyTvd0_hqTRkP16-FRCEQxo,7663
16
16
  elody/object_configurations/elody_configuration.py,sha256=Bchwd1roBnrMDTdFkJUlUTS_FkrzhAq2kVdphLCdu2M,10621
17
17
  elody/object_configurations/job_configuration.py,sha256=-wZi9bM3jEgyrfuBfMalrsMovb3_zx14rZFW3htGLPs,7511
18
18
  elody/object_configurations/saved_search_configuration.py,sha256=ddOry4EqYOeEKRF7q2M_fHoqZv8DXpQjFq8VaZ7jhVI,732
19
19
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  elody/policies/helpers.py,sha256=G9B7IHO1h-dNtAPsRtmHN-wYat7F-1ryk32mcCetsgI,2505
21
- elody/policies/permission_handler.py,sha256=Ok5ojzwuLVe6H3wDusVeihSG2o4_HF9__1qlX01tdAU,15705
21
+ elody/policies/permission_handler.py,sha256=cOvJ4Wjg6mJS0pgZS4CQMjFqID2ST1Z2LF67emtpaGw,15838
22
22
  elody/policies/authentication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  elody/policies/authentication/base_user_tenant_validation_policy.py,sha256=p7draxPCqly1vy7vnJX-gpmRfDeyaTxt9Cf0YpH9PZI,5829
24
24
  elody/policies/authentication/multi_tenant_policy.py,sha256=g4ZYUQMmCjgLg09wj0-0lGKsJsRt7h4ppI25o1VdZHw,4039
@@ -36,13 +36,13 @@ elody/policies/authorization/mediafile_derivatives_policy.py,sha256=OwNpbS8i7-Lz
36
36
  elody/policies/authorization/mediafile_download_policy.py,sha256=XMsKavBucmTh4W1kWOzpFWxJ_ZXgHVK1RS7JB4HjtQo,1979
37
37
  elody/policies/authorization/multi_tenant_policy.py,sha256=SA9H7SBjzuh8mY3gYN7pDG8TV7hdI3GEUtNeiZeNL3M,3164
38
38
  elody/policies/authorization/tenant_request_policy.py,sha256=dEgblwRAqwWVcE-O7Jn8hVL3OnwDlQhDEOcPlcElBrk,1185
39
- elody-0.0.229.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
39
+ elody-0.0.231.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
40
40
  tests/__init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
42
42
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
44
44
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
45
- elody-0.0.229.dist-info/METADATA,sha256=NDNbVKONUcM86RNVy8FLaocQ1jcj_t_XWPmSZs8m0oE,23358
46
- elody-0.0.229.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
- elody-0.0.229.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
48
- elody-0.0.229.dist-info/RECORD,,
45
+ elody-0.0.231.dist-info/METADATA,sha256=K-GvWQvJr1Rg1xKObO3DYZovwBt9TO_sJrR3s0Pf4og,23358
46
+ elody-0.0.231.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ elody-0.0.231.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
48
+ elody-0.0.231.dist-info/RECORD,,