Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LICENSES/CLA-signed-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A/ You have read and agree to the individual CLA: https://merginmaps.com/license
* `alhirzel`, 20th December 2023
* `uprel`, 18th March 2024
* `enockseth`, 5th May 2025
* `silentsudo-io`, 9th August 2026

B/ I have read and agree with entity CLA for my company: https://merginmaps.com/licenses/entity-cla

Expand Down
7 changes: 7 additions & 0 deletions server/mergin/sync/public_api_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ def add_project(namespace): # noqa: E501

db.session.add(p)
db.session.add(version)
# Grant the creator ownership of the project they have just created.
# Without this the project has no roles at all, so it cannot be shared,
# and under GLOBAL_ADMIN=True its own creator cannot see it.
p.set_role(current_user.id, ProjectRole.OWNER)
db.session.commit()
project_version_created.send(version)
return NoContent, 200
Expand Down Expand Up @@ -1296,6 +1300,9 @@ def clone_project(namespace, project_name): # noqa: E501
device_id,
)
db.session.add(project_version)
# Same as in add_project: the creator of a cloned project must hold a role
# on it, otherwise the clone cannot be shared or, for a non-superuser, seen.
p.set_role(current_user.id, ProjectRole.OWNER)
db.session.commit()
project_version_created.send(project_version)
return NoContent, 200
Expand Down