move logic out of template

Also just drop some of it as redundant (the check for whether the user could
see permissions was the same as whether they could view the character)