Skip to content

Add @mm_project_role QGIS variable for the current user's project role #4648

Description

@gabriel-bolbotina

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions