RBAC Handler Error

I need this :
We have an entity with a country variable. A product that is sold in certain countries. How can we make it so that a user can only edit those entities from a specific country?