In a democracy no power is absolute and their are limits to all authority.
A person in authority must act within the limits of his/her authority.
All persons must follow the rule of the law. No person is above the law.
Persons in authority can issue only lawful orders. No person inside or outside the chain of command is obliged to obey an illegal order.
All people within and outside will have recourse to appeal an unlawful or an arbitrary order to an higher level within the government or to an administrative judge (magistrate) or challenge such an order in a court of law.