The referee has sole decision-making power.
In addition to displaying off balls (flag held upwards) or good balls (flag held downwards) the referee is used to rule violations or other important game situations, such as substitutions, injuries, unsportsmanlike conduct etc.