{"action":"created","issue":{"url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/4","repository_url":"https://api.github.com/repos/jaumard/trailpack-acl","labels_url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/4/comments","events_url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/4/events","html_url":"https://github.com/jaumard/trailpack-acl/pull/4","id":182959629,"number":4,"title":"Support for waterline as ORM","user":{"login":"catrielmuller","id":2272323,"avatar_url":"https://avatars.githubusercontent.com/u/2272323?v=3","gravatar_id":"","url":"https://api.github.com/users/catrielmuller","html_url":"https://github.com/catrielmuller","followers_url":"https://api.github.com/users/catrielmuller/followers","following_url":"https://api.github.com/users/catrielmuller/following{/other_user}","gists_url":"https://api.github.com/users/catrielmuller/gists{/gist_id}","starred_url":"https://api.github.com/users/catrielmuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catrielmuller/subscriptions","organizations_url":"https://api.github.com/users/catrielmuller/orgs","repos_url":"https://api.github.com/users/catrielmuller/repos","events_url":"https://api.github.com/users/catrielmuller/events{/privacy}","received_events_url":"https://api.github.com/users/catrielmuller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-14T04:12:27Z","updated_at":"2016-12-30T20:25:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jaumard/trailpack-acl/pulls/4","html_url":"https://github.com/jaumard/trailpack-acl/pull/4","diff_url":"https://github.com/jaumard/trailpack-acl/pull/4.diff","patch_url":"https://github.com/jaumard/trailpack-acl/pull/4.patch"},"body":"@jaumard Hey Man.\nI promised, here is!\nSupport for waterline as ORM\n\nThe only new feature is the variable defaultRegisterRole for use this variable in another auth trailpack (Tomorrow i will send a pr to trailpack-passport for implement this)\n\nTake a look and tell me whats you think.\nCheers\n"},"comment":{"url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/comments/269818000","html_url":"https://github.com/jaumard/trailpack-acl/pull/4#issuecomment-269818000","issue_url":"https://api.github.com/repos/jaumard/trailpack-acl/issues/4","id":269818000,"user":{"login":"matteozambon89","id":2357170,"avatar_url":"https://avatars.githubusercontent.com/u/2357170?v=3","gravatar_id":"","url":"https://api.github.com/users/matteozambon89","html_url":"https://github.com/matteozambon89","followers_url":"https://api.github.com/users/matteozambon89/followers","following_url":"https://api.github.com/users/matteozambon89/following{/other_user}","gists_url":"https://api.github.com/users/matteozambon89/gists{/gist_id}","starred_url":"https://api.github.com/users/matteozambon89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteozambon89/subscriptions","organizations_url":"https://api.github.com/users/matteozambon89/orgs","repos_url":"https://api.github.com/users/matteozambon89/repos","events_url":"https://api.github.com/users/matteozambon89/events{/privacy}","received_events_url":"https://api.github.com/users/matteozambon89/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T20:25:36Z","updated_at":"2016-12-30T20:25:36Z","body":"@catrielmuller @jaumard \r\nIs there anybody still working on this trailpack?\r\n`isUserAllowed` inside `api/services/permissionServices.js` has some issue which could cause a response error 500.\r\nI've fixed it like this:\r\n- Read `permissions.userRoleFieldName` from `app.config` like for sequelize\r\n- In case user doesn't have roles, leave `promises` as empty array\r\n\r\n```\r\n        this.app.orm.User.findOne({where: {id: user.id}}).populate(_.get(this.app.config, 'permissions.userRoleFieldName', 'roles')).exec((err, dbuser) => {\r\n          if (!err){\r\n            const promises = []\r\n            if(dbuser){\r\n              const roles = dbuser.roles\r\n\r\n              roles.forEach(role => {\r\n                promises.push(this.isAllowed(role.name, resourceName, actionName))\r\n              })\r\n            }\r\n```"}}
{"actor":{"display_login":"matteozambon89"}}