{"action":"created","issue":{"url":"https://api.github.com/repos/alanning/meteor-roles/issues/157","labels_url":"https://api.github.com/repos/alanning/meteor-roles/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/alanning/meteor-roles/issues/157/comments","events_url":"https://api.github.com/repos/alanning/meteor-roles/issues/157/events","html_url":"https://github.com/alanning/meteor-roles/issues/157","id":122057688,"number":157,"title":"!Roles.userIsInRole(Meteor.user(), ['admin']) not working as expected in firefox(42.0 for ubuntu).","user":{"login":"piyushmahensaria","id":12864068,"avatar_url":"https://avatars.githubusercontent.com/u/12864068?v=3","gravatar_id":"","url":"https://api.github.com/users/piyushmahensaria","html_url":"https://github.com/piyushmahensaria","followers_url":"https://api.github.com/users/piyushmahensaria/followers","following_url":"https://api.github.com/users/piyushmahensaria/following{/other_user}","gists_url":"https://api.github.com/users/piyushmahensaria/gists{/gist_id}","starred_url":"https://api.github.com/users/piyushmahensaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyushmahensaria/subscriptions","organizations_url":"https://api.github.com/users/piyushmahensaria/orgs","repos_url":"https://api.github.com/users/piyushmahensaria/repos","events_url":"https://api.github.com/users/piyushmahensaria/events{/privacy}","received_events_url":"https://api.github.com/users/piyushmahensaria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T14:51:46Z","updated_at":"2015-12-14T15:40:24Z","closed_at":null,"body":"I am trying to write a onBeforeAction in routing javascript file (name:common.js, it is placed in a folder common to server and client called libs), but the routing does not happen because,\r\n\r\nIn Firefox:\r\n`!Roles.userIsInRole(Meteor.user(), ['admin'])` returns **true** (unexpected) during execution in **javascript (common.js)**, which I know because I used alert(), \r\nand if I execute `!Roles.userIsInRole(Meteor.user(), ['admin'])` in **browser console** itself, then it returns **false** (expected).\r\nI even tried moving common.js to client side, the issue still prevails.\r\n\r\nIn Chrome:\r\nI know this is a issue because, it executes perfectly in Chrome, and returns **false** in **browser console** and **common.js** (as expected, in any case, even if common.js is on clientside or in common folder).\r\n\r\n\r\nJust in case it helps (code):\r\n```\r\nRouter.route('/rolesadmin', {\r\n        template: 'adminTemplate',\r\n        onBeforeAction: function() {\r\n            alert(!Roles.userIsInRole(Meteor.user(), ['admin']));\r\n            if (Meteor.loggingIn()) {\r\n                this.render(this.loadingTemplate);\r\n            } else if(!Roles.userIsInRole(Meteor.user(), ['admin'])) {\r\n                this.redirect('/');\r\n            }\r\n            else{\r\n                this.next();\r\n            }\r\n        }\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/alanning/meteor-roles/issues/comments/164470415","html_url":"https://github.com/alanning/meteor-roles/issues/157#issuecomment-164470415","issue_url":"https://api.github.com/repos/alanning/meteor-roles/issues/157","id":164470415,"user":{"login":"piyushmahensaria","id":12864068,"avatar_url":"https://avatars.githubusercontent.com/u/12864068?v=3","gravatar_id":"","url":"https://api.github.com/users/piyushmahensaria","html_url":"https://github.com/piyushmahensaria","followers_url":"https://api.github.com/users/piyushmahensaria/followers","following_url":"https://api.github.com/users/piyushmahensaria/following{/other_user}","gists_url":"https://api.github.com/users/piyushmahensaria/gists{/gist_id}","starred_url":"https://api.github.com/users/piyushmahensaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyushmahensaria/subscriptions","organizations_url":"https://api.github.com/users/piyushmahensaria/orgs","repos_url":"https://api.github.com/users/piyushmahensaria/repos","events_url":"https://api.github.com/users/piyushmahensaria/events{/privacy}","received_events_url":"https://api.github.com/users/piyushmahensaria/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T15:40:24Z","updated_at":"2015-12-14T15:40:24Z","body":"On trying out a little more, I figured, if I execute the command `!Roles.userIsInRole(Meteor.user(), ['admin'])` anywhere else on client side or in common folder, it performs as expected in firefox as well. Confused with the issue."}}