Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
realm: Allow only owners to change restricted-login related settings.
Sahil Batra1396fbab6eb7
diff --git a/zerver/tests/test_realm.py b/zerver/tests/test_realm.pyindex 8bda4ee198b..dc32066c2a2 100644--- a/zerver/tests/test_realm.py+++ b/zerver/tests/test_realm.py@@ -1402,6 +1402,8 @@ class RealmAPITest(ZulipTestCase):def test_changing_user_joining_settings_require_owners(self) -> None:self.do_test_changing_settings_by_owners_only("invite_to_realm_policy")self.do_test_changing_settings_by_owners_only("invite_required")+ self.do_test_changing_settings_by_owners_only("emails_restricted_to_domains")+ self.do_test_changing_settings_by_owners_only("disallow_disposable_email_addresses")def test_enable_spectator_access_for_limited_plan_realms(self) -> None:self.login("iago")diff --git a/zerver/views/realm.py b/zerver/views/realm.pyindex 7375994b57e..83565a42218 100644--- a/zerver/views/realm.py+++ b/zerver/views/realm.py@@ -182,6 +182,11 @@ def update_realm() and not user_profile.is_realm_owner:raise OrganizationOwnerRequired()+ if (+ emails_restricted_to_domains is not None or disallow_disposable_email_addresses is not None+ ) and not user_profile.is_realm_owner:+ raise OrganizationOwnerRequired()+if enable_spectator_access:realm.ensure_not_on_limited_plan()