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.

Field type permissions

See original GitHub issue

Hi! I have tested permissions applied to type which is returned from query and it seems not to work when resolvers for type were not explicitly defined: for e.g. this works when I do query me:

const resolvers = {
  Query: {
    me: (_, args, ctx) => ctx.user;
  },
  User: {
    name(parent, args, ctx) { return parent.name; }
  }
}

const permissions = shield({
  User: {
    name: allow
  }
})

and this doesn’t, although it has allow rule:

const resolvers = {
  Query: {
    me: (_, args, ctx) => ctx.user;
  }
}

const permissions = shield({
  User: {
    name: allow
  }
})

Always getting Not Authorised! error.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
maticzavcommented, Jun 4, 2018

Try upgrading graphql-yoga to the latest version.

The issue about type resolvers has been resolved in one of the latest versions of graphql-middleware which should have, as well, been updated in Yoga.

Tell me if that worked out for you! 🙂

0reactions
maticzavcommented, Jun 4, 2018

No problem, I am glad it worked 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Field Permissions - Salesforce Help
Field permissions specify the access level for each field in an object. In permission sets and the enhanced profile user interface, the setting...
Read more >
Type Field Permissions - SmartWiki
The Type Field Permissions control the visibility of the field or button for ... Allow View Field – Defines on which templates/types the...
Read more >
Field Permissions | Drupal.org
The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.
Read more >
Field permissions - Documentation for Action Request System ...
Field permissions determine the types of access that groups or roles have for individual fields in a form: ... If neither permission is...
Read more >
Configuring custom field permissions
In the main navigation menu go to Administer > Custom Fields. · Select a custom field. · Under Security Options, click Add Permission....
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