{"action":"opened","issue":{"url":"https://api.github.com/repos/miguelalarcos/roles-e/issues/2","labels_url":"https://api.github.com/repos/miguelalarcos/roles-e/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/miguelalarcos/roles-e/issues/2/comments","events_url":"https://api.github.com/repos/miguelalarcos/roles-e/issues/2/events","html_url":"https://github.com/miguelalarcos/roles-e/issues/2","id":79842743,"number":2,"title":"Suggestion : setRolesToUser()","user":{"login":"dagatsoin","id":3670794,"avatar_url":"https://avatars.githubusercontent.com/u/3670794?v=3","gravatar_id":"","url":"https://api.github.com/users/dagatsoin","html_url":"https://github.com/dagatsoin","followers_url":"https://api.github.com/users/dagatsoin/followers","following_url":"https://api.github.com/users/dagatsoin/following{/other_user}","gists_url":"https://api.github.com/users/dagatsoin/gists{/gist_id}","starred_url":"https://api.github.com/users/dagatsoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagatsoin/subscriptions","organizations_url":"https://api.github.com/users/dagatsoin/orgs","repos_url":"https://api.github.com/users/dagatsoin/repos","events_url":"https://api.github.com/users/dagatsoin/events{/privacy}","received_events_url":"https://api.github.com/users/dagatsoin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-23T13:07:54Z","updated_at":"2015-05-23T13:07:54Z","closed_at":null,"body":"For now, when I want to replace a role I do the following:\r\n\r\n```\r\nMeteor.methods({\r\n  \r\n  setRoleToUser: function (role, userId) {\r\n    // First, empty the roles array\r\n    Meteor.users.update({_id:userId}, {$unset:{roles:\"\"}});\r\n\r\n    // Second, set a new role\r\n    roleE.addRolesToUser([role],userId);\r\n  }\r\n});\r\n```\r\nIt could be nice to do just:\r\n```\r\nMeteor.methods({\r\n  setRoleToUser: function (role, userId) {\r\n    roleE.setRolesToUser([role],userId);\r\n  }\r\n});\r\n```\r\n\r\nMy 2 cts."}}