-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve user/group filter to allow multiple users/groups #4559
Improve user/group filter to allow multiple users/groups #4559
Conversation
eb2061e
to
114c7c4
Compare
114c7c4
to
1cf5691
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
72ed743
to
01a8330
Compare
E2E tests are failing because of the new group, about the checkboxes in the administration panel, in the "Map repository" creation. |
…ups separated by comma
0c5c617
to
4fc54e4
Compare
Fixed ! |
…n with GetFeatureInfo JSON checks
The end2end PlayWright test needs 3liz/qgis-lizmap-server-plugin#86 to pass |
I added the Draft flag again, as I am still working on it to use the new behaviour only:
This will allow Lizmap default behaviour to not change between version 3.7 and 3.8 and let the editor control this new feature. It is safer as a specific index must be added to have good performance with the new multiple value search. |
a6e11fb
to
29ba3d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add to check during this review, the plugin is generating true boolean values ;-)
tests/units/classes/Project/Ressources/edition_embed_parent_filtered.qgs.cfg
Outdated
Show resolved
Hide resolved
tests/units/classes/Project/Ressources/edition_embed_parent_filtered.qgs.cfg
Outdated
Show resolved
Hide resolved
…reSQL layers & if allow_multiple_acl_values is true
29ba3d0
to
0c1f319
Compare
Lizmap Web Client allows filtering the content of vector layers depending on the authenticated user. Before version 3.8, for the attribute filter, every layer to filter must have a field which value must be only one group identifier (or one user login), such as:
This modification allows using a list of groups (or a list of users) separated with a comma (with no spaces) inside the field used as the source of filtering. This will ease showing some features for more than one group (or user). For example, the filtered layer could contain:
We focus on keeping the filter sent to the layer provider as standard as possible, to be able to be directly used by PostgreSQL and avoid evaluating a complex expression on all features.
This new feature is only available:
These safeguards allow Lizmap default behaviour to not change between version 3.7 and 3.8. The map editor will decide to manually activate this new feature. It is safer, as a specific index must be added to have good performance with the new multiple value search.
The filter is built this way:
LIKE
statements combining all possibilities. For example, the above example will lead to a filter like this if the authenticated user is in the groupgroup_a
:On big datasets, a proper
GIN
index using the extensionpg_trgm
is highly recommended.Linked to 3liz/qgis-lizmap-server-plugin#86
Funded by: Conseil Départemental du Calvados https://www.calvados.fr/