How to set Limit of a relation

Ok, and the second part of the question, how to make this custom controller restriction reflected in the Strapi UI?