mirror of https://github.com/zulip/zulip.git
realm: Default can_create_groups to moderators for education realms.
This commit is contained in:
parent
d7d03628d0
commit
4a1b67804f
|
@ -295,7 +295,11 @@ def do_create_realm(
|
|||
"can_create_public_channel_group": {
|
||||
Realm.ORG_TYPES["education_nonprofit"]["id"]: SystemGroups.ADMINISTRATORS,
|
||||
Realm.ORG_TYPES["education"]["id"]: SystemGroups.ADMINISTRATORS,
|
||||
}
|
||||
},
|
||||
"can_create_groups": {
|
||||
Realm.ORG_TYPES["education_nonprofit"]["id"]: SystemGroups.MODERATORS,
|
||||
Realm.ORG_TYPES["education"]["id"]: SystemGroups.MODERATORS,
|
||||
},
|
||||
}
|
||||
set_default_for_realm_permission_group_settings(
|
||||
realm, group_settings_defaults_for_org_types
|
||||
|
|
|
@ -125,6 +125,11 @@ class RealmTest(ZulipTestCase):
|
|||
)
|
||||
self.assertEqual(realm.user_group_edit_policy, CommonPolicyEnum.MODERATORS_ONLY)
|
||||
self.assertEqual(realm.invite_to_stream_policy, CommonPolicyEnum.MODERATORS_ONLY)
|
||||
realm = get_realm("test_education_non_profit")
|
||||
moderators_group = NamedUserGroup.objects.get(
|
||||
name=SystemGroups.MODERATORS, realm=realm, is_system_group=True
|
||||
)
|
||||
self.assertEqual(realm.can_create_groups.id, moderators_group.id)
|
||||
|
||||
def test_permission_for_education_for_profit_organization(self) -> None:
|
||||
realm = do_create_realm(
|
||||
|
@ -145,6 +150,11 @@ class RealmTest(ZulipTestCase):
|
|||
)
|
||||
self.assertEqual(realm.user_group_edit_policy, CommonPolicyEnum.MODERATORS_ONLY)
|
||||
self.assertEqual(realm.invite_to_stream_policy, CommonPolicyEnum.MODERATORS_ONLY)
|
||||
realm = get_realm("test_education_for_profit")
|
||||
moderators_group = NamedUserGroup.objects.get(
|
||||
name=SystemGroups.MODERATORS, realm=realm, is_system_group=True
|
||||
)
|
||||
self.assertEqual(realm.can_create_groups.id, moderators_group.id)
|
||||
|
||||
def test_realm_enable_spectator_access(self) -> None:
|
||||
realm = do_create_realm(
|
||||
|
|
Loading…
Reference in New Issue