I cover this topic in this tutorial: Next.js and Strapi CRUD Permissions
It is using Next.js, I show you how to create custom middleware to check if user is the owner as well us how to inject that middleware to users-permission plugin to only give the ability to the user to update content that they created.