Skip to content

Commit

Permalink
Reflect layer share rules server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Nov 30, 2023
1 parent 2f128a5 commit 1ba68fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tekst-API/tekst/models/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ def model_postprocess(self):
self.owner_id = None
self.shared_read = []
self.shared_write = []
# shares
self.shared_write = [
user_id for user_id in self.shared_write if user_id != self.owner_id
]
self.shared_read = [
user_id
for user_id in self.shared_read
if user_id != self.owner_id and user_id not in self.shared_write
]
return self

def restricted_fields(self, user: UserRead | None = None) -> set[str] | None:
Expand Down

0 comments on commit 1ba68fb

Please sign in to comment.