Skip to content

Commit d2d8eb9

Browse files
committed
project push: fail early if user does not have write permissions
1 parent 67131fe commit d2d8eb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mergin/client_push.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def push_project_async(mc, directory):
8888

8989
mp.log.info(f"got project info. version {server_version}")
9090

91+
username = mc.username()
92+
if username not in server_info["access"]["writersnames"]:
93+
mp.log.error(f"--- push {project_path} - username {username} does not have write access")
94+
raise ClientError(f"You do not seem to have write access to the project (username '{username}')")
95+
9196
if local_version != server_version:
9297
mp.log.error(f"--- push {project_path} - not up to date (local {local_version} vs server {server_version})")
9398
raise ClientError("There is a new version of the project on the server. Please update your local copy." +

0 commit comments

Comments
 (0)