diff --git a/LICENSES/CLA-signed-list.md b/LICENSES/CLA-signed-list.md index 1f4c1cc9..00542ca6 100644 --- a/LICENSES/CLA-signed-list.md +++ b/LICENSES/CLA-signed-list.md @@ -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 diff --git a/server/mergin/sync/public_api_controller.py b/server/mergin/sync/public_api_controller.py index 34a2d28f..bda53a95 100644 --- a/server/mergin/sync/public_api_controller.py +++ b/server/mergin/sync/public_api_controller.py @@ -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 @@ -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