{"action":"created","issue":{"url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/147","repository_url":"https://api.github.com/repos/kahmali/meteor-restivus","labels_url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/147/comments","events_url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/147/events","html_url":"https://github.com/kahmali/meteor-restivus/issues/147","id":116615624,"number":147,"title":"Role check does not account for alanning:role \"groups\" ","user":{"login":"rwakida","id":5505749,"avatar_url":"https://avatars.githubusercontent.com/u/5505749?v=3","gravatar_id":"","url":"https://api.github.com/users/rwakida","html_url":"https://github.com/rwakida","followers_url":"https://api.github.com/users/rwakida/followers","following_url":"https://api.github.com/users/rwakida/following{/other_user}","gists_url":"https://api.github.com/users/rwakida/gists{/gist_id}","starred_url":"https://api.github.com/users/rwakida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwakida/subscriptions","organizations_url":"https://api.github.com/users/rwakida/orgs","repos_url":"https://api.github.com/users/rwakida/repos","events_url":"https://api.github.com/users/rwakida/events{/privacy}","received_events_url":"https://api.github.com/users/rwakida/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kahmali/meteor-restivus/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/kahmali/meteor-restivus/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-12T18:51:49Z","updated_at":"2016-03-10T22:45:15Z","closed_at":null,"body":"The restivus role check does not use the alanning:roles API.  It assumes that roles are the direct child of the user, but alanning:role supports \"groups\" which store user roles as a grandchild of the user.  \r\n\r\nrestivus role check:\r\n```\r\n  _roleAccepted: (endpointContext, endpoint) ->\r\n    if endpoint.roleRequired\r\n      if _.isEmpty _.intersection(endpoint.roleRequired, endpointContext.user.roles)\r\n        return false\r\n    true\r\n```\r\n\r\nNeed to use alanning:role's, ` Roles.userIsInRole method `, to authorize based on role.  https://github.com/alanning/meteor-roles#groups"},"comment":{"url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/comments/195084303","html_url":"https://github.com/kahmali/meteor-restivus/issues/147#issuecomment-195084303","issue_url":"https://api.github.com/repos/kahmali/meteor-restivus/issues/147","id":195084303,"user":{"login":"kahmali","id":935297,"avatar_url":"https://avatars.githubusercontent.com/u/935297?v=3","gravatar_id":"","url":"https://api.github.com/users/kahmali","html_url":"https://github.com/kahmali","followers_url":"https://api.github.com/users/kahmali/followers","following_url":"https://api.github.com/users/kahmali/following{/other_user}","gists_url":"https://api.github.com/users/kahmali/gists{/gist_id}","starred_url":"https://api.github.com/users/kahmali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kahmali/subscriptions","organizations_url":"https://api.github.com/users/kahmali/orgs","repos_url":"https://api.github.com/users/kahmali/repos","events_url":"https://api.github.com/users/kahmali/events{/privacy}","received_events_url":"https://api.github.com/users/kahmali/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T22:45:15Z","updated_at":"2016-03-10T22:45:15Z","body":"@nikos If nobody else submits a PR I'll try to fix this up next time I'm updating Restivus. Other than that I haven't used the roles package enough to give any recommendation. Wish I could be more helpful. I'll keep you posted on any progress I make with the fix. "}}