code: def can_add_post(self, topic, user):
          
          can_add_post = self._perform_basic_permission_check(
              topic.forum, user, 'can_reply_to_topics',
          )
          can_add_post &= (
              not topic.is_locked or
              self._perform_basic_permission_check(topic.forum, user, 'can_reply_to_locked_topics')
          )
          return can_add_post
docs: Given a topic, checks whether the user can append posts to it.