Edit: Ultimately I switched to keystone js v5. I can do all this in 1/10 the time with better documentation.
I'm trying to figure out how to implement a Strapi isOwner policy.
They created official documentation and locked out the issue.
The only problem is that the documentation doesn't actually use policies even though it is titled "Create is owner policy". It modifies how to update and create a thing. Now, I could use these same methodologies to create a new find method, but I'd rather use a policy.
The thing that spurred this question is in the GraphQL documentation:
resolver: {
Query: {
restaurant: {
description: 'Return a single restaurant',
policies: ['plugins::users-permissions.isAuthenticated', 'isOwner'], // Apply the 'isAuthenticated' policy of the `Users & Permissions` plugin, then the 'isOwner' policy before executing the resolver.
},
How would such a policy 'isOwner' be implemented?
The best answer I can find is this post in the GitHub issue, but the reason I'm posting this question is the the official documentation is not what this post says and seems to contradict itself with the "policy" that's actually a controller along with the GraphQL documentation alluding to a policy that could exist which aligns with the GitHub post.