settings: Migrate to stream_post_policy structure.

This commit includes a new `stream_post_policy` setting,
by replacing the `is_announcement_only` field from the Stream model,
which is done by mirroring the structure of the existing
`create_stream_policy`.

It includes the necessary schema and database migrations to migrate
the is_announcement_only boolean field to stream_post_policy,
a smallPositiveInteger field similar to many other settings.

This change is done to allow organization administrators to restrict
new members from creating and posting to a stream. However, this does
not affect admins who are new members.

With many tweaks by tabbott to documentation under /help, etc.

Fixes #13616.
This commit is contained in:
Ryan Rehman
2020-02-05 02:20:55 +05:30
committed by Tim Abbott
parent 31aecc0abb
commit 174b2abcfd
60 changed files with 525 additions and 189 deletions

View File

@@ -328,7 +328,7 @@ def update_stream(client, stream_id):
# Update the stream by a given ID
request = {
'stream_id': stream_id,
'is_announcement_only': True,
'stream_post_policy': 2,
'is_private': True,
}