mirror of https://github.com/zulip/zulip.git
Remove public_streams_disabled.
(imported from commit 1d0c8db92bf8e4c44bd1c96063acfd6eea74925c)
This commit is contained in:
parent
d2979ab5d4
commit
3515a69e43
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue