Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Forbidden Access to threadOf Attribute #200

Answered by StoCreator
StoCreator asked this question in Q&A
Discussion options

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.

You must be logged in to vote

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

Comment options

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.

You must be logged in to vote
2 replies
Comment options

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.

Comment options

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 return and check if you've got all properties returned (including threadOf)
  • try to use the build in query and just provide the authorUser prop, that should do the same as your custom one
Comment options

Thank you for your answer and sorry for the late reply.

We now solved the problem by adding the following Code to the resolversConfig:

Unbenannt

You must be logged in to vote
0 replies
Answer selected by StoCreator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /