diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index ba63a8b692..5be6173f34 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2807,10 +2807,8 @@ def do_get_streams(user_profile, include_public=True, include_subscribed=True, if include_all_active and not is_super_user(user_profile): raise JsonableError("User not authorized for this query") - # Listing public streams are disabled for some users (e.g. a - # contractor for CUSTOMER5) and for the mit.edu realm. - include_public = include_public and not (user_profile.public_streams_disabled or - user_profile.realm.domain == "mit.edu") + # Listing public streams are disabled for the mit.edu realm. + include_public = include_public and user_profile.realm.domain != "mit.edu" # Start out with all streams in the realm with subscribers query = get_occupied_streams(user_profile.realm) diff --git a/zerver/models.py b/zerver/models.py index af8d698090..8b3d013872 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -384,10 +384,6 @@ class UserProfile(AbstractBaseUser, PermissionsMixin): def is_admin(self): return self.has_perm('administer', self.realm) - @property - def public_streams_disabled(self): - return self.email.lower() == "restricted-user@customer5.invalid" - def last_reminder_tzaware(self): if self.last_reminder is not None and timezone.is_naive(self.last_reminder): logging.warning("Loaded a user_profile.last_reminder for user %s that's not tz-aware: %s" diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 0c9e41d62a..455263390f 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -1472,9 +1472,8 @@ def filter_stream_authorization(user_profile, streams): if stream.id in streams_subscribed: continue - # The user is not authorized for invite_only streams, and if - # the user has public streams disabled, nothing is authorized - if stream.invite_only or user_profile.public_streams_disabled: + # The user is not authorized for invite_only streams + if stream.invite_only: unauthorized_streams.append(stream) streams = [stream for stream in streams if