Allow API clients to view !YOU! submissions.

pull/19/head
float trip 2022-11-26 18:06:04 +00:00
parent d624dbe2de
commit df4eb02c0e
1 changed files with 1 additions and 2 deletions

View File

@ -1000,7 +1000,7 @@ class User(Base):
if not cls.can_see(user, other.author): return False if not cls.can_see(user, other.author): return False
if user and user.id == other.author_id: return True if user and user.id == other.author_id: return True
if isinstance(other, Submission): if isinstance(other, Submission):
if "!YOU!" in other.title and not (user and user.truescore > 5000): return False if "!YOU!" in other.title and not (user and (user.client or user.truescore > 5000)): return False
if other.sub and not cls.can_see(user, other.subr): return False if other.sub and not cls.can_see(user, other.subr): return False
else: else:
if not other.parent_submission: if not other.parent_submission:
@ -1016,7 +1016,6 @@ class User(Base):
return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned
return True return True
@property @property
@lazy @lazy
def can_see_chudrama(self): def can_see_chudrama(self):