-
Notifications
You must be signed in to change notification settings - Fork 75
Forbidden Access to threadOf Attribute #200
-
Hello everybody,
we have a problem with the plugin. Whenever we try to query the comments plugin we get a forbidden access message. This only happens when we try to query the field "threadOf".
We already had a look at the admin panel concerning the authorization permission, but nothing helps.
Is there anybody who knows how to deactivate authoritazion for the comments plugin or has other ideas?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions
Thank you for your answer and sorry for the late reply.
We now solved the problem by adding the following Code to the resolversConfig:
Replies: 2 comments 2 replies
-
Can you please provide a query examples and responses?
That would be good if you'll check as well if proper endpoints got applied access rights for public / authorized.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello cyp3rius,
thank you for your answer.
First of all we are using Strapi 4 and graphql as query language.
Here is the schema of the usercomments that comes out of our docs:
Unbenannt
This is an example how we query the object:
1
That is what we gat as a result:
Unbenann1t
In the custom resolver for usercomments we return the object like the following:
Unbenandnt
We already set the user authorization for usercomments to false in the resolverconfig.
The Forbidden Error message only appears when we try to query the threadOf object. We can query everything else without getting the error message.
Thank you in advance for your help. Please let us know if you need more information.
Beta Was this translation helpful? Give feedback.
All reactions
-
It's hard to say as you already mentioned that you've got custom resolver so the error is caused by something inside. What you can do is:
- log your data structures before
returnand check if you've got all properties returned (includingthreadOf) - try to use the build in query and just provide the
authorUserprop, that should do the same as your custom one
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your answer and sorry for the late reply.
We now solved the problem by adding the following Code to the resolversConfig:
Beta Was this translation helpful? Give feedback.