Filial adoption, in making us partakers by grace in the divine nature, can bestow true merit on us as a result of God's gratuitous justice. This is our right by grace, the full right of love, making us "co-heirs" with Christ and worthy of obtaining "the promised inheritance of eternal life." The merits of our good works are gifts of the divine goodness. "Grace has gone before us; now we are given what is due.... Our merits are God's gifts."
Source: Catechism of the Catholic Church (Vatican.va)