question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"You do not have access to this resource"

See original GitHub issue

Getting the following error trying to execute the following query:

mutation{
         updateActiveOffer(id: "5d7d7476c9bb8714baa52d5a", data : { quantity:2 }){
	quantity
            offer{
              name
            }
	}
}
  "errors": [
    {
      "message": "You do not have access to this resource",
      "name": "AccessDeniedError",
      "time_thrown": "2019-09-15T01:39:39.829Z",
      "data": {
        "type": "mutation",
        "target": "updateActivedOffer"
      },
      "path": [
        "updateActivedOffer"
      ],
      "uid": "ck0kbaoqd00021m3a900r0j1w"
    }
  ],
  "data": {
    "updateActivedOffer": null
  }
}

I’ve removed any authStrategy and here is the list’s configaration-

exports.ActiveOffers = {
    fields: {
        offer: {
            type: Relationship,
            ref: 'Offer',
            many: false
        },
        assosciatedUser: { type: Relationship, ref: 'User', many: false },
        // expires: { type: DateTime },
        quantity: { type: Integer },
        slug: {
            type: Slug,
            from: 'offer'
        },

    },
    access: {
        create: true,
        read: true,
        update: true,
        delete: true,
    },
    labelResolver: async (item) => {
        return `${item.offer} <${item.quantity}>`
    },
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MadeByMikecommented, Sep 17, 2019

Thanks! I’ll make an issue for a better error message and close this one. @Nakzz Thanks for your help in reporting issues recently. I hope this resolves it for you and you’re able to get your project running.

If you need more help with this, or other general questions jump onto the community slack channel: http://community.keystonejs.com I’m usually hanging around there and will be able to offer more help.

1reaction
jesstelfordcommented, Sep 17, 2019

I’m guessing this fails because there is no string representation for the offer? Perhaps you are not allowed to use ‘from’ on Relationships?

This is correct; the Slug.from setting should point to a field which has a text value. We could do better at attempting to resolve that and throw a more useful error.

As it stands, the configuration for ActiveOffers.slug should probably be removed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forbidden: You don't have permission to access this resource.
Hi. Yesterday, I was working on the above site preparing for a possible transfer and probably got rid of a plugin or 2,...
Read more >
What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
403 Forbidden – you don't have permission to access this resource is an HTTP status code that occurs when the web server understands...
Read more >
Solved: You Don't Have Permission to Access on This Server
This guide covered several fixes to this problem. Resetting the filesystem permission for Apache should be the first resort. If the error ...
Read more >
"Forbidden - You don't have permission to access / on this ...
1. Incorrect File / Directory Permissions ... This error can be triggered due to incorrect file/folder permissions on the webroot directory. If ...
Read more >
You do not have authorization to access this resource
Microsoft Q&A is the best place to get answers to all your technical questions on Microsoft products and services. Community. Forum.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found