mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
streams: Refactor code to set group-based stream settings.
We add stream_permission_group_settings object which is similar to property_types framework used for realm settings. This commit also adds GroupPermissionSetting dataclass for defining settings inside stream_permission_group_settings. We add "do_change_stream_group_based_setting" function which is called in loop to update all the group-based stream settings and it is now used to update 'can_remove_subscribers_group' setting instead of "do_change_can_remove_subscribers_group". We also change the variable name for event_type field of RealmAuditLog objects to STREAM_GROUP_BASED_SETTING_CHANGED since this will be used for all group-based stream settings. 'property' field is also added to extra_data field to identify the setting for which RealmAuditLog object was created. We will add a migration in further commits which will add the property field to existing RealmAuditLog objects created for changing can_remove_subscribers_group setting.
This commit is contained in:
@@ -272,3 +272,10 @@ class RealmPlaygroundDict(TypedDict):
|
||||
name: str
|
||||
pygments_language: str
|
||||
url_prefix: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class GroupPermissionSetting:
|
||||
require_system_group: bool
|
||||
allow_internet_group: bool
|
||||
allow_owners_group: bool
|
||||
|
||||
Reference in New Issue
Block a user