{"action":"created","issue":{"url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/2","repository_url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions","labels_url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/2/comments","events_url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/2/events","html_url":"https://github.com/MichielDeMey/express-jwt-permissions/issues/2","id":122345180,"number":2,"title":"Permission denied when no user object is set","user":{"login":"MichielDeMey","id":793406,"avatar_url":"https://avatars.githubusercontent.com/u/793406?v=3","gravatar_id":"","url":"https://api.github.com/users/MichielDeMey","html_url":"https://github.com/MichielDeMey","followers_url":"https://api.github.com/users/MichielDeMey/followers","following_url":"https://api.github.com/users/MichielDeMey/following{/other_user}","gists_url":"https://api.github.com/users/MichielDeMey/gists{/gist_id}","starred_url":"https://api.github.com/users/MichielDeMey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichielDeMey/subscriptions","organizations_url":"https://api.github.com/users/MichielDeMey/orgs","repos_url":"https://api.github.com/users/MichielDeMey/repos","events_url":"https://api.github.com/users/MichielDeMey/events{/privacy}","received_events_url":"https://api.github.com/users/MichielDeMey/received_events","type":"User","site_admin":false},"labels":[{"id":298561032,"url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"MichielDeMey","id":793406,"avatar_url":"https://avatars.githubusercontent.com/u/793406?v=3","gravatar_id":"","url":"https://api.github.com/users/MichielDeMey","html_url":"https://github.com/MichielDeMey","followers_url":"https://api.github.com/users/MichielDeMey/followers","following_url":"https://api.github.com/users/MichielDeMey/following{/other_user}","gists_url":"https://api.github.com/users/MichielDeMey/gists{/gist_id}","starred_url":"https://api.github.com/users/MichielDeMey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichielDeMey/subscriptions","organizations_url":"https://api.github.com/users/MichielDeMey/orgs","repos_url":"https://api.github.com/users/MichielDeMey/repos","events_url":"https://api.github.com/users/MichielDeMey/events{/privacy}","received_events_url":"https://api.github.com/users/MichielDeMey/received_events","type":"User","site_admin":false},"assignees":[{"login":"MichielDeMey","id":793406,"avatar_url":"https://avatars.githubusercontent.com/u/793406?v=3","gravatar_id":"","url":"https://api.github.com/users/MichielDeMey","html_url":"https://github.com/MichielDeMey","followers_url":"https://api.github.com/users/MichielDeMey/followers","following_url":"https://api.github.com/users/MichielDeMey/following{/other_user}","gists_url":"https://api.github.com/users/MichielDeMey/gists{/gist_id}","starred_url":"https://api.github.com/users/MichielDeMey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichielDeMey/subscriptions","organizations_url":"https://api.github.com/users/MichielDeMey/orgs","repos_url":"https://api.github.com/users/MichielDeMey/repos","events_url":"https://api.github.com/users/MichielDeMey/events{/privacy}","received_events_url":"https://api.github.com/users/MichielDeMey/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2015-12-15T19:20:54Z","updated_at":"2016-11-02T12:30:25Z","closed_at":"2015-12-15T20:12:36Z","body":"When a user object is not set, the middleware throws a permissions error.\nNot having a user object simply means that the route doesn't require any authentication/authorization.\n"},"comment":{"url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/comments/257850988","html_url":"https://github.com/MichielDeMey/express-jwt-permissions/issues/2#issuecomment-257850988","issue_url":"https://api.github.com/repos/MichielDeMey/express-jwt-permissions/issues/2","id":257850988,"user":{"login":"bveenema","id":6935674,"avatar_url":"https://avatars.githubusercontent.com/u/6935674?v=3","gravatar_id":"","url":"https://api.github.com/users/bveenema","html_url":"https://github.com/bveenema","followers_url":"https://api.github.com/users/bveenema/followers","following_url":"https://api.github.com/users/bveenema/following{/other_user}","gists_url":"https://api.github.com/users/bveenema/gists{/gist_id}","starred_url":"https://api.github.com/users/bveenema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bveenema/subscriptions","organizations_url":"https://api.github.com/users/bveenema/orgs","repos_url":"https://api.github.com/users/bveenema/repos","events_url":"https://api.github.com/users/bveenema/events{/privacy}","received_events_url":"https://api.github.com/users/bveenema/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T12:30:25Z","updated_at":"2016-11-02T12:30:25Z","body":"Sorry for my confusion, but doesn't #7 refer to the requestProperty and not a missing user object on req?\r\n\r\nI was referring to this:\r\n``` JavaScript\r\ntest('no user object present, should pass', function (t) {\r\n  var req = {}\r\n  guard.check(['ping'])(req, res, t.end)\r\n})\r\n```\r\n\r\nMy assertion is that if a user object is missing on req, we should validate the permissions. I wrote this test which is passing, and in I'm not sure it should.\r\n\r\n``` JavaScript\r\ntest('this shouldn\\'t pass', function (t) {\r\n  var guard = require('../index')({\r\n    requestProperty: 'foo',\r\n    permissionsProperty: 'bar'\r\n  })\r\n  var req = { identity: { scopes: ['foobar'] } }\r\n  guard.check('ping')(req, res, t.end)\r\n})\r\n```\r\n\r\nMaybe I'm thinking about this incorrectly."}}
{"actor":{"display_login":"bveenema"}}