fix: filter on is_active in channel membership checks (#23623)
is_user_channel_member and is_user_channel_manager did not filter on is_active, allowing deactivated members to retain read/write access to group channels via direct API calls.
This commit is contained in:
@@ -508,6 +508,7 @@ class ChannelTable:
|
||||
.filter(
|
||||
ChannelMember.channel_id == channel_id,
|
||||
ChannelMember.user_id == user_id,
|
||||
ChannelMember.is_active.is_(True),
|
||||
ChannelMember.role == 'manager',
|
||||
)
|
||||
.first()
|
||||
@@ -667,6 +668,7 @@ class ChannelTable:
|
||||
.filter(
|
||||
ChannelMember.channel_id == channel_id,
|
||||
ChannelMember.user_id == user_id,
|
||||
ChannelMember.is_active.is_(True),
|
||||
)
|
||||
.first()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user