MerginMaps / MerginMaps/mobile
Add @mm_project_role QGIS variable for the current user's project role
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 388
- Forks
- 87
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 20
Description
## Current situation
The current user's role on a project isn't reachable from expressions, so authors can't set up expression-based behaviour that depends on the user's role.
## What we want
A new Mergin variable, `@mm_project_role`, returning the current user's role on the active project, usable in expressions and form default values (like the other mm_* variables in the mobile app).
## Expected behavior (user's view)
- Returns the user's role on the open project as text.
- Works offline and stays correct after syncing.
- Empty when signed out or the project isn't a Mergin project.
The same expression must give the same result in QGIS and in the field, so the variable name and role values need to match the plugin exactly.
TBD: which role values users will see (reader/editor/writer/owner, and whether admin appears). Should mirror what the app already shows for roles.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing mm_* variables in the mobile app and checking the plugin's displayed project-role values. Review the expression and form-default integration plus offline and sync handling; done means @mm_project_role returns the matching role, is empty in the stated inactive cases, and produces the same result in QGIS and the field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100