userRight calculation fix for JSON encoding