<xf:if is="{$xf.visitor.user_id} == {$post.user_id} OR {$xf.visitor.is_staff}">
{{ bb_code($post.message, 'post', $post) }}
<xf:else />
<div class="noViewPermission">
You can only view your own messages.
</div>
</xf:if>
You will probably need to modify other templates aswell, like preview etc.
<xf:if is="{$xf.visitor.user_id} == {$post.user_id} OR {$xf.visitor.is_staff}">
{{ bb_code($post.message, 'post', $post) }}
<xf:else />
<div class="noViewPermission">
You can only view your own messages.
</div>
</xf:if>
You will probably need to modify other templates aswell, like preview etc.