mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	default stream: Allows admins to remove any default stream.
This fixes a bug where administrators couldn't remove private unsubscribed streams from the "default streams" list, because access_stream_by_name didn't give them access to the stream object.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							c41c82aae0
						
					
				
				
					commit
					6e136be975
				
			@@ -102,14 +102,16 @@ def check_stream_name_available(realm: Realm, name: str) -> None:
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
def access_stream_by_name(user_profile: UserProfile,
 | 
			
		||||
                          stream_name: str) -> Tuple[Stream, Recipient, Optional[Subscription]]:
 | 
			
		||||
                          stream_name: str,
 | 
			
		||||
                          allow_realm_admin: bool=False) -> Tuple[Stream, Recipient, Optional[Subscription]]:
 | 
			
		||||
    error = _("Invalid stream name '%s'" % (stream_name,))
 | 
			
		||||
    try:
 | 
			
		||||
        stream = get_realm_stream(stream_name, user_profile.realm_id)
 | 
			
		||||
    except Stream.DoesNotExist:
 | 
			
		||||
        raise JsonableError(error)
 | 
			
		||||
 | 
			
		||||
    (recipient, sub) = access_stream_common(user_profile, stream, error)
 | 
			
		||||
    (recipient, sub) = access_stream_common(user_profile, stream, error,
 | 
			
		||||
                                            allow_realm_admin=allow_realm_admin)
 | 
			
		||||
    return (stream, recipient, sub)
 | 
			
		||||
 | 
			
		||||
def access_stream_for_unmute_topic(user_profile: UserProfile, stream_name: str, error: str) -> Stream:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user