according to what sb decides or wishes to do
at sb's discretion
Bail is granted at the discretion of the court.
Definitions from the Oxford Advanced Learner's Dictionary, 9th edition