Books could be written about this. In federal laws, subject to contrary intention, ‘may’ signifies discretion7. But, where a statute says an official ‘may’ confer some benefit subject to preconditions, their satisfaction can create a legal duty to act8.
In this case, the legislation said the official ‘may’ determine costs which should be paid if the official was of the opinion that payment was ‘justified’9. Once that opinion was formed, it followed that the official had to determine costs and pay them. There was no discretion10. iTip – have a look at Pearce & Geddes (at [11.3-11.17]) to see how the courts approach these delicate issues.
This case is from Episode 12 of interpretationNOW!
7 s 33(2A) of the Acts Interpretation Act 1901.
9 s 4(2) of the Costs in Criminal Cases Act 1967 (NSW).
10 Tillman  NSWCA 119 (at [30-37]) explains further.