Server 10 added the realm_can_delete_any_message_group permission. For servers before that, we're meant to use role:administrators when deciding whether to show the "delete message" button, but (with #1842, not yet merged) we'll actually use role:nobody. We should fix that and refactor a bit; see discussion: #1842 (comment)