Overview
QFieldCloud’s collaboration system allows multiple users to work together on projects with role-based access control. TheProjectCollaborator model manages user permissions and determines what actions each team member can perform.
Collaboration Model
TheProjectCollaborator model is defined in core/models.py:1981 and creates a many-to-many relationship between projects and users.
Key Fields
- project: Foreign key to the Project
- collaborator: Foreign key to User (Person or Team)
- role: Collaboration role (Admin, Manager, Editor, Reporter, Reader)
- is_incognito: Whether collaborator is hidden in UI and billing
- created_by: User who added the collaborator
- created_at: Timestamp when added
- updated_by: User who last updated the collaborator
- updated_at: Timestamp of last update
Collaboration Roles
QFieldCloud defines five collaboration roles with varying permission levels:Admin
Full project control:- Manage collaborators
- Delete the project
- Update project settings
- Upload/download files
- Create and apply deltas
- Trigger packaging jobs
Manager
Project management without deletion:- Manage collaborators (cannot remove admins)
- Update project settings
- Upload/download files
- Create and apply deltas
- Trigger packaging jobs
Editor
Full editing capabilities:- Upload/download files
- Create and apply deltas
- Trigger packaging jobs
- Cannot modify project settings or collaborators
Reporter
Data submission only:- Create deltas (submit field data)
- Download project files
- Cannot upload files directly
- Cannot apply deltas
Reader
Read-only access:- Download project files
- View project information
- Cannot make any changes
Adding Collaborators
API Endpoint
Request Body
Example with cURL
Validation Rules
When adding collaborators, the following rules are enforced:- Cannot add project owner - The owner is implicitly an admin
- Organization membership required - For organization-owned projects, collaborators must be organization members
- No duplicate collaborators - Each user can only be added once per project
- Subscription limits - Private projects enforce max collaborator limits based on the owner’s plan
core/models.py:2052 for validation logic.
Organization-Owned Projects
For projects owned by an organization:Member Requirements
Team Collaborators
Organizations can add entire teams as collaborators:Managing Collaborators
List Collaborators
Update Collaborator Role
Remove Collaborator
Permissions System
The permissions system checks multiple factors:Role Origin
Users can have project roles from multiple sources:Permission Checks
Key permission functions incore/permissions_utils.py:
can_create_collaborators(user, project)- Check if user can add collaboratorscan_update_collaborators(user, project)- Check if user can modify collaboratorscan_delete_collaborators(user, project)- Check if user can remove collaboratorscan_read_collaborators(user, project)- Check if user can view collaborator list
core/views/collaborators_views.py:14 for permission implementation.
Subscription Limits
Collaborator Validation
Private projects enforce collaborator limits based on the owner’s subscription:max_premium_collaborators_per_private_project is:
-1: Unlimited collaboratorsn > 0: Maximum of n collaborators
core/models.py:1930 for validation queryset.
Direct Collaborators
Get non-owner collaborators:core/models.py:1846.
Incognito Collaborators
Special flag for support users:- Function normally with assigned role
- Hidden from collaborator lists in UI
- Not counted toward subscription limits
- Used for OPENGIS.ch support access
Project Roles View
TheProjectRolesView is a database view that aggregates user roles:
core/models.py:2081.
Best Practices
Role Selection Guidelines
- Admin: Project leads, IT administrators
- Manager: Field coordinators, data managers
- Editor: GIS analysts, data collectors with upload rights
- Reporter: Field workers using QField mobile
- Reader: Stakeholders needing view-only access
Security Considerations
- Principle of least privilege - Grant minimum necessary permissions
- Regular audits - Review collaborator lists periodically
- Organization structure - Use teams for consistent permissions
- Public projects - Remember all authenticated users can read public projects
Performance
- Use
skip_incognito()when counting collaborators for billing - Query with
select_related("collaborator")to avoid N+1 queries - Filter invalid collaborators with
validated(skip_invalid=True)
API Reference
List All Collaborators
Get Collaborator Details
Update Role
Remove Collaborator
Related Resources
- Projects - Creating and managing projects
- Organizations - Organization membership and teams
- Permissions - Detailed permission matrix