Skip to content

Commit a33443e

Browse files
MarcelGeowonder-sk
authored andcommitted
Fix: add default values for share command
1 parent adaff97 commit a33443e

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

mergin/cli.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,21 @@ def share(ctx, project):
315315
return
316316
access_list = mc.project_user_permissions(project)
317317

318-
for username in access_list.get("owners"):
318+
owners = access_list.get("owners", [])
319+
writers = access_list.get("writers", [])
320+
editors = access_list.get("editors", [])
321+
readers = access_list.get("readers", [])
322+
323+
for username in owners:
319324
click.echo("{:20}\t{:20}".format(username, "owner"))
320-
for username in access_list.get("writers"):
321-
if username not in access_list.get("owners"):
325+
for username in writers:
326+
if username not in owners:
322327
click.echo("{:20}\t{:20}".format(username, "writer"))
323-
for username in access_list.get("editors"):
324-
if username not in access_list.get("writers"):
328+
for username in editors:
329+
if username not in writers:
325330
click.echo("{:20}\t{:20}".format(username, "editor"))
326-
for username in access_list.get("readers"):
327-
if username not in access_list.get("editors"):
331+
for username in readers:
332+
if username not in editors:
328333
click.echo("{:20}\t{:20}".format(username, "reader"))
329334

330335

0 commit comments

Comments
 (0)