<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def can_add_post(self, topic, user):
 """ Given a topic, checks whether the user can append posts to it. """

        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