                                :author
                                :viewer)
         base-access {:role     role
-                     :premium? premium?}
-        ;; viewer role is allowed only on premium
-        premium-viewer-role (if premium? :viewer :author)]
+                     :premium? premium?}]
     (cond
 
       ;; a named author of this private board

                   member? :member
                   :else   :anonymous)
        base-access {:role role
                     :premium? premium?}
        premium-viewer-access (if premium? :viewer :author)]
    (cond
      ;; an admin of this org's team
      ((set admin) (:team-id org))


      ;; a named viewer of this board
      (and (= board-access :private) (board-viewers user-id))
      (merge base-access {:access-level :viewer})

      ;; a team member on a non-private board
      (and (not= board-access :private) ((set teams) (:team-id org)))
      (merge base-access {:access-level :viewer})

      ;; anyone else on a public board IF the org allows public boards
      (and (= board-access :public) (not (-> org :content-visibility :disallow-public-board)))
