In San Francisco and some neighboring cities, every permit is discretionary either directly or through ambiguity (https://law.ucdavis.edu/sites/g/files/dgvnsk10866/files/medi...), but it doesn’t have to be that way.