Added the _hasPermission function