mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
streams: Allow stream admin to update and deactivate streams.
The new Stream administrator role is allowed to manage a stream they administer, including: * Setting properties like name, description, privacy and post-policy. * Removing subscribers * Deactivating the stream The access_stream_for_delete_or_update is modified and is used only to get objects from database and further checks for administrative rights is done by check_stream_access_for_delete_or_update. We have also added a new exception class StreamAdministratorRequired.
This commit is contained in:
@@ -224,6 +224,18 @@ class OrganizationOwnerRequired(JsonableError):
|
||||
def msg_format() -> str:
|
||||
return OrganizationOwnerRequired.OWNER_REQUIRED_MESSAGE
|
||||
|
||||
class StreamAdministratorRequired(JsonableError):
|
||||
code: ErrorCode = ErrorCode.UNAUTHORIZED_PRINCIPAL
|
||||
|
||||
ADMIN_REQUIRED_MESSAGE = _("Must be an organization or stream administrator")
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__(self.ADMIN_REQUIRED_MESSAGE)
|
||||
|
||||
@staticmethod
|
||||
def msg_format() -> str:
|
||||
return StreamAdministratorRequired.ADMIN_REQUIRED_MESSAGE
|
||||
|
||||
class MarkdownRenderingException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user