MerginMaps / mobile

Mobile app for Mergin Maps 📲. Open QGIS projects and manage vector data on your phone, even offline 📶 (Android/iOS/Windows app)
https://merginmaps.com
GNU General Public License v2.0
280 stars 62 forks source link

Filtering visibility with rule-based rendering by username makes features un-editable #3497

Open raherin opened 3 weeks ago

raherin commented 3 weeks ago

When using rule-based rendering to only allow a user to see features they've created, a feature becomes un-editable once it has been created, even when being edited by the user who created it.

Example

I have created an example project support/rules-based-rendering where there is a field called UserName which is set to default value @mergin_username . Rendering for the layer is rule based and there is a filter on all points so only the user who created the point and a designated admin user - in this case support can view the points. The expression for the filter is:

 "UserName" = @mergin_username OR @mergin_username = 'support'

Prior to the update to mobile version 2024.1.0, this worked as expected. A user could only see features that they created or had the UserName field set to their username and they could also edit those features in the app. However, since updating to the latest version of the app, features are no longer editable after they have been saved. A user can create new features and see features with their username, but they cannot edit them. See the video below for an example:

https://github.com/MerginMaps/mobile/assets/26321345/263ce815-ae9e-40ee-9c0c-d9390a4de21a