Let \(\mathcal {A}\) be an associative algebra containing either classical or quantum universal enveloping algebra of a semi-simple complex Lie algebra \(\mathfrak {g}\) . We present a construction of the Mickelsson algebra \(Z(\mathcal {A},\mathfrak {g})\) relative to the left ideal in \(\mathcal {A}\) generated by positive root vectors. Our method employs a calculus on Hasse diagrams associated with classical or quantum \(\mathfrak {g}\) -modules. We give an explicit expression for a PBW basis in \(Z(\mathcal {A},\mathfrak {g})\) in the case when \(\mathcal {A}=U(\mathfrak {a})\) of a finite-dimensional Lie algebra \(\mathfrak {a}\supset \mathfrak {g}\) . For \(\mathcal {A}=U_q(\mathfrak {a})\) and \(\mathfrak {g}\) the commutant of a Levi subalgebra in \(\mathfrak {a}\) , we construct a PBW basis in terms of quantum Lax operators, upon extension of the ground ring of scalars to \(\mathbb {C}[[\hbar ]]\) .