mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
types: Add default_group_name field to GroupPermissionSetting type.
This commit adds default_group_name field to GroupPermissionSetting type which will be used to store the name of the default group for that setting which would in most cases be one of the role-based system groups. This will be helpful when we would have multiple settings and we would need to set the defaults while creating realm and streams.
This commit is contained in:
@@ -280,3 +280,4 @@ class GroupPermissionSetting:
|
||||
allow_internet_group: bool
|
||||
allow_owners_group: bool
|
||||
allow_nobody_group: bool
|
||||
default_group_name: str
|
||||
|
||||
@@ -2643,6 +2643,7 @@ class Stream(models.Model):
|
||||
allow_internet_group=False,
|
||||
allow_owners_group=False,
|
||||
allow_nobody_group=False,
|
||||
default_group_name=UserGroup.ADMINISTRATORS_GROUP_NAME,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -591,8 +591,13 @@ def add_subscriptions_backend(
|
||||
allow_nobody_group=False,
|
||||
)
|
||||
else:
|
||||
can_remove_subscribers_group_default = Stream.stream_permission_group_settings[
|
||||
"can_remove_subscribers_group"
|
||||
].default_group_name
|
||||
can_remove_subscribers_group = UserGroup.objects.get(
|
||||
name="@role:administrators", realm=user_profile.realm, is_system_group=True
|
||||
name=can_remove_subscribers_group_default,
|
||||
realm=user_profile.realm,
|
||||
is_system_group=True,
|
||||
)
|
||||
|
||||
for stream_dict in streams_raw:
|
||||
|
||||
Reference in New Issue
Block a user