Fixed typo

`if hasperm` -> `ifhasperm`