c2cgeoportal-geoportal 2.9.0.202__py3-none-any.whl → 2.9.0.204__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.
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2024, Camptocamp SA
1
+ # Copyright (c) 2011-2025, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,7 @@ from sqlalchemy import ColumnElement, and_, desc, func, or_
38
38
  from c2cgeoportal_commons.models import DBSession
39
39
  from c2cgeoportal_commons.models.main import FullTextSearch, Interface
40
40
  from c2cgeoportal_geoportal import locale_negotiator
41
+ from c2cgeoportal_geoportal.lib import get_roles_id
41
42
  from c2cgeoportal_geoportal.lib.caching import get_region
42
43
  from c2cgeoportal_geoportal.lib.common_headers import Cache, set_common_headers
43
44
  from c2cgeoportal_geoportal.lib.fulltextsearch import Normalize
@@ -98,16 +99,21 @@ class FullTextSearchView:
98
99
  ]
99
100
  terms_ts = "&".join(w + ":*" for w in terms_array if w != "")
100
101
  _filter: ColumnElement[bool] = FullTextSearch.ts.op("@@")(func.to_tsquery(language, terms_ts))
101
-
102
102
  if self.request.user is None:
103
- _filter = and_(_filter, FullTextSearch.public.is_(True))
103
+ _filter = and_(
104
+ _filter,
105
+ or_(
106
+ FullTextSearch.public.is_(True),
107
+ FullTextSearch.role_id.in_(get_roles_id(self.request)),
108
+ ),
109
+ )
104
110
  else:
105
111
  _filter = and_(
106
112
  _filter,
107
113
  or_(
108
114
  FullTextSearch.public.is_(True),
109
115
  FullTextSearch.role_id.is_(None),
110
- FullTextSearch.role_id.in_([r.id for r in self.request.user.roles]),
116
+ FullTextSearch.role_id.in_(get_roles_id(self.request)),
111
117
  ),
112
118
  )
113
119
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cgeoportal-geoportal
3
- Version: 2.9.0.202
3
+ Version: 2.9.0.204
4
4
  Summary: c2cgeoportal geoportal
5
5
  Home-page: https://github.com/camptocamp/c2cgeoportal/
6
6
  Author: Camptocamp
@@ -156,7 +156,7 @@ c2cgeoportal_geoportal/views/__init__.py,sha256=KNfldZFuKFfNjGJsE2HyW3gUfWUY5IKS
156
156
  c2cgeoportal_geoportal/views/dev.py,sha256=4_xprN8ccbiEInXcpIWRGI55nU7LZI98JN7rNy4sQVg,2539
157
157
  c2cgeoportal_geoportal/views/dynamic.py,sha256=w92NRkIn0Ahahn0LG9F-KpMOx0lhffZxK4ecn6k8i40,8907
158
158
  c2cgeoportal_geoportal/views/entry.py,sha256=wlDCRGNpFlECGgwLktBEQckFAz0XBWuVwS8vHSGfBLA,6931
159
- c2cgeoportal_geoportal/views/fulltextsearch.py,sha256=uiidVzz-mQ-_eF1GL3ZCWd67-p-PNnqE7QZkBxsro4Q,8397
159
+ c2cgeoportal_geoportal/views/fulltextsearch.py,sha256=i6d0-1N2pNG6KWq9Bih_kD4TQAZ54zMbuOFZTN-fqaU,8602
160
160
  c2cgeoportal_geoportal/views/geometry_processing.py,sha256=5dkJ20Lk12zqfzvmfws2YFxutSX2vxzdetQ4CmYxSi8,2958
161
161
  c2cgeoportal_geoportal/views/i18n.py,sha256=EEyM5Y7DSuQffiwpFrkFclUcneRCiir4bakXY6lGZjI,5343
162
162
  c2cgeoportal_geoportal/views/layers.py,sha256=I1_9N8Zui4b2t9qfX1Z4QGX7-vOPeUKKvyJWLH8g9Fo,29226
@@ -187,8 +187,8 @@ tests/test_mapserverproxy_route_predicate.py,sha256=SzILSSzIuilzIkUYVPZiVzLwW1du
187
187
  tests/test_raster.py,sha256=82NJ2MXgZlMqs0ytN-VgNw376iURdk4PkAg__dyh5ns,11948
188
188
  tests/test_wmstparsing.py,sha256=xjA8nJuXFl3H5Bfs4sJw_8qX8E8qvAALK7Hs2-DTP2A,9054
189
189
  tests/xmlstr.py,sha256=rkTKSU4FGjupBKLx75H8o-goB0KbQrxDvdpc6xVX_uQ,5985
190
- c2cgeoportal_geoportal-2.9.0.202.dist-info/METADATA,sha256=BPjtxiAPi9MYsdJdzIAyZKDia6lChv9EdbgMoNrsSWk,1923
191
- c2cgeoportal_geoportal-2.9.0.202.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
192
- c2cgeoportal_geoportal-2.9.0.202.dist-info/entry_points.txt,sha256=3dnX260FsLX_AubeNMdyeta_z1X4CxcD3steAlfPx2I,1414
193
- c2cgeoportal_geoportal-2.9.0.202.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
194
- c2cgeoportal_geoportal-2.9.0.202.dist-info/RECORD,,
190
+ c2cgeoportal_geoportal-2.9.0.204.dist-info/METADATA,sha256=sQeWroAUFcENGRZbL50nNim689XGfPoCLdnDjVTAtas,1923
191
+ c2cgeoportal_geoportal-2.9.0.204.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
192
+ c2cgeoportal_geoportal-2.9.0.204.dist-info/entry_points.txt,sha256=3dnX260FsLX_AubeNMdyeta_z1X4CxcD3steAlfPx2I,1414
193
+ c2cgeoportal_geoportal-2.9.0.204.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
194
+ c2cgeoportal_geoportal-2.9.0.204.dist-info/RECORD,,