         role (cond admin?  :admin
                    member? :member
                    :else   :anonymous)
-        base-access {:role role :premium? premium?}]
+        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 team member of this org
      ((set teams) (:team-id org))
      (merge base-access {:access-level :viewer})

      ;; public access to orgs w/ at least 1 public board AND that allow public boards
      (and

        board-authors (set (:authors board))
        board-viewers (set (:viewers board))
        premium? (premium-org? org user)
        org-member? ((set teams) (:team-id org))
        admin? ((set admin) (:team-id org))
        role (cond admin?      :admin
                   org-member? :member
                   :else       :anonymous)
        publisher-board-role (if (= (str board-res/publisher-board-slug-prefix user-id) (:slug board))
                               :author
                               :viewer)
        base-access {:role     role
                     :premium? premium?}
        ;; viewer role is allowed only on premium
        premium-viewer-role (if premium? :viewer :author)]
    (cond

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

      (and (= board-access :team)
           (:publisher-board board))
      (merge base-access {:access-level publisher-board-role})

      ;; an admin of this org's team for this non-private board
      (and (not= board-access :private) ((set admin) (:team-id org)))
