Fix bug for model permission