{"action":"created","issue":{"url":"https://api.github.com/repos/feathersjs/feathers/issues/405","repository_url":"https://api.github.com/repos/feathersjs/feathers","labels_url":"https://api.github.com/repos/feathersjs/feathers/issues/405/labels{/name}","comments_url":"https://api.github.com/repos/feathersjs/feathers/issues/405/comments","events_url":"https://api.github.com/repos/feathersjs/feathers/issues/405/events","html_url":"https://github.com/feathersjs/feathers/issues/405","id":176517659,"number":405,"title":"`hook.app` is undefined in Event filters","user":{"login":"sscaff1","id":1554424,"avatar_url":"https://avatars.githubusercontent.com/u/1554424?v=3","gravatar_id":"","url":"https://api.github.com/users/sscaff1","html_url":"https://github.com/sscaff1","followers_url":"https://api.github.com/users/sscaff1/followers","following_url":"https://api.github.com/users/sscaff1/following{/other_user}","gists_url":"https://api.github.com/users/sscaff1/gists{/gist_id}","starred_url":"https://api.github.com/users/sscaff1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sscaff1/subscriptions","organizations_url":"https://api.github.com/users/sscaff1/orgs","repos_url":"https://api.github.com/users/sscaff1/repos","events_url":"https://api.github.com/users/sscaff1/events{/privacy}","received_events_url":"https://api.github.com/users/sscaff1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-13T00:20:28Z","updated_at":"2016-09-15T02:34:48Z","closed_at":"2016-09-15T02:34:48Z","body":"I'm using sequelize. Here is an example scenario of when I need to use this functionality. I have users in groups. When users send a message, I need to see if they are part of that group before allowing them to see the data. GroupUsers is a mapping table mapping groups to users.\r\n\r\nMy event filter is below. If you `console.log(hook.app)`, it logs `undefined`.\r\n```\r\nexport default function () {\r\n  return function filterGroupId(data, connection, hook) {\r\n    const query = {\r\n      userId: connection.user.id,\r\n      groupId: data.groupId,\r\n      deleted: false,\r\n    };\r\n    return hook.app.service('groupUsers').find({ query })\r\n    .then(result => {\r\n      if (result.total > 0) {\r\n        return data;\r\n      }\r\n      return false;\r\n    });\r\n  };\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/feathersjs/feathers/issues/comments/247216960","html_url":"https://github.com/feathersjs/feathers/issues/405#issuecomment-247216960","issue_url":"https://api.github.com/repos/feathersjs/feathers/issues/405","id":247216960,"user":{"login":"daffl","id":338316,"avatar_url":"https://avatars.githubusercontent.com/u/338316?v=3","gravatar_id":"","url":"https://api.github.com/users/daffl","html_url":"https://github.com/daffl","followers_url":"https://api.github.com/users/daffl/followers","following_url":"https://api.github.com/users/daffl/following{/other_user}","gists_url":"https://api.github.com/users/daffl/gists{/gist_id}","starred_url":"https://api.github.com/users/daffl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daffl/subscriptions","organizations_url":"https://api.github.com/users/daffl/orgs","repos_url":"https://api.github.com/users/daffl/repos","events_url":"https://api.github.com/users/daffl/events{/privacy}","received_events_url":"https://api.github.com/users/daffl/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T02:34:48Z","updated_at":"2016-09-15T02:34:48Z","body":"Closed via #406"}}
{"actor":{"display_login":"daffl"}}