From 5739f128cf29448e5e48952fd7cb55f5f32060fc Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 5 Oct 2022 21:52:15 -0700 Subject: [PATCH] club and chudrama permissions --- files/classes/user.py | 9 +++++---- files/helpers/const.py | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 464811623..68e917aab 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -414,9 +414,10 @@ class User(Base): @property @lazy def paid_dues(self): - if not FEATURES['COUNTRY_CLUB']: - return True - return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins >= dues)) + if not FEATURES['COUNTRY_CLUB']: return True + if self.shadowbanned: return False + if self.is_suspended_permanently: return False + return self.admin_level >= PERMS['VIEW_CLUB'] or self.club_allowed or (self.club_allowed != False and self.truecoins >= dues) @lazy def any_block_exists(self, other): @@ -926,7 +927,7 @@ class User(Base): @property @lazy def can_see_chudrama(self): - if self.admin_level: return True + if self.admin_level >= PERMS['VIEW_CHUDRAMA']: return True if self.client: return True if self.truecoins >= 5000: return True if self.agendaposter: return True diff --git a/files/helpers/const.py b/files/helpers/const.py index d03c8247b..e35019384 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -150,6 +150,8 @@ PERMS = { # Minimum admin_level to perform action. 'LOTTERY_ADMIN': 3, 'LOTTERY_VIEW_PARTICIPANTS': 2, 'VIEW_MODMAIL': 2, + 'VIEW_CLUB': 1, + 'VIEW_CHUDRAMA': 1, 'PRINT_MARSEYBUX_FOR_KIPPY_ON_PCMEMES': 3, 'VIEW_ACTIVE_USERS': 2, 'MERGE_USERS': 3, # note: extra check for Aevann