Fix parameters of function has_permission