mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
messages: Support passing user ID for stream operator.
ok_to_include_history fuction was updated to expect stream ID. Fixes part of #9474.
This commit is contained in:
committed by
Tim Abbott
parent
5eab5bbc3e
commit
3680393b47
@@ -186,6 +186,13 @@ def can_access_stream_history_by_name(user_profile: UserProfile, stream_name: st
|
||||
return False
|
||||
return can_access_stream_history(user_profile, stream)
|
||||
|
||||
def can_access_stream_history_by_id(user_profile: UserProfile, stream_id: int) -> bool:
|
||||
try:
|
||||
stream = get_stream_by_id_in_realm(stream_id, user_profile.realm)
|
||||
except Stream.DoesNotExist:
|
||||
return False
|
||||
return can_access_stream_history(user_profile, stream)
|
||||
|
||||
def filter_stream_authorization(user_profile: UserProfile,
|
||||
streams: Iterable[Stream]) -> Tuple[List[Stream], List[Stream]]:
|
||||
streams_subscribed = set() # type: Set[int]
|
||||
|
||||
Reference in New Issue
Block a user