Skip to content

Commit

Permalink
feat: consider queued when verifying the retrieve permission
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder committed Nov 16, 2023
1 parent b7dc773 commit eb8a186
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion chats/apps/discussions/models/discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,15 @@ def is_admin_manager_or_creator(self, user):
def can_retrieve(self, user):
if self.added_users.filter(permission__user=user).exists():
return True
if self.is_admin_manager_or_creator(user):
return True
if (
self.is_queued
and self.queue.authorizations.filter(permission__user=user).exists()
):
return True

return self.is_admin_manager_or_creator(user)
return False


class DiscussionUser(BaseModel):
Expand Down

0 comments on commit eb8a186

Please sign in to comment.