Exemple #1
0
 def can_close(self, user: User):
     if not user.is_banned() and not self.is_closed:
         if user.is_admin() or self.user_id == user.id:
             return True
         else:
             return False
     else:
         return False
Exemple #2
0
 def can_post(self, user: User):
     if user.is_banned():
         return False
     if self.is_writeable and not self.is_closed:
         return True
     elif not self.is_writeable and (
             self.user_id == user.id
             or user.is_admin()) and not self.is_closed:
         return True
     else:
         return False
Exemple #3
0
 def can_delete(self, user: User):
     return user.is_admin()
Exemple #4
0
 def can_change(self, user: User):
     if not self.topic.can_post(user):
         return False
     return user.id == self.user_id or user.is_admin()
Exemple #5
0
 def can_change(self, user: User):
     return user.is_admin()