{"action":"created","issue":{"url":"https://api.github.com/repos/Narzerus/angular-permission/issues/81","labels_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/81/comments","events_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/81/events","html_url":"https://github.com/Narzerus/angular-permission/issues/81","id":104891913,"number":81,"title":"Issue on state authorization","user":{"login":"jkeczan","id":193130,"avatar_url":"https://avatars.githubusercontent.com/u/193130?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeczan","html_url":"https://github.com/jkeczan","followers_url":"https://api.github.com/users/jkeczan/followers","following_url":"https://api.github.com/users/jkeczan/following{/other_user}","gists_url":"https://api.github.com/users/jkeczan/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeczan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeczan/subscriptions","organizations_url":"https://api.github.com/users/jkeczan/orgs","repos_url":"https://api.github.com/users/jkeczan/repos","events_url":"https://api.github.com/users/jkeczan/events{/privacy}","received_events_url":"https://api.github.com/users/jkeczan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-04T13:31:44Z","updated_at":"2015-10-09T20:03:40Z","closed_at":null,"body":"When a state is found to be authorized, the code that allows the state to continue and broadcasts the success message.\r\n\r\nHowever, we are getting an error '$$hashKey' not defined on state change. We traced it back to angular-permission line 49. In the source, you said this is a hacky fix that should be fixed in later versions on UI-router. Could this be the culprit?\r\n\r\n```\r\nPermission.defineRole('projectmanager', function(stateParams) {\r\n       var deferred = $q.defer();\r\n\r\n       $http.get('/api/managers').then(function(data) {\r\n           var isPM = false;\r\n           for (var i = 0; i < data.data.length; i++) {\r\n               if (data.data[i].projectMgr == $rootScope.session.projectMgr) {\r\n                   isPM = true;\r\n                   break;\r\n               }\r\n           }\r\n           if (isPM) {\r\n               deferred.resolve();\r\n           } else {\r\n               deferred.reject();\r\n           }\r\n       }, function() {\r\n           deferred.reject();\r\n       });\r\n       return deferred.promise;\r\n   });\r\n```"},"comment":{"url":"https://api.github.com/repos/Narzerus/angular-permission/issues/comments/146974279","html_url":"https://github.com/Narzerus/angular-permission/issues/81#issuecomment-146974279","issue_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/81","id":146974279,"user":{"login":"christopherthielen","id":2053478,"avatar_url":"https://avatars.githubusercontent.com/u/2053478?v=3","gravatar_id":"","url":"https://api.github.com/users/christopherthielen","html_url":"https://github.com/christopherthielen","followers_url":"https://api.github.com/users/christopherthielen/followers","following_url":"https://api.github.com/users/christopherthielen/following{/other_user}","gists_url":"https://api.github.com/users/christopherthielen/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherthielen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherthielen/subscriptions","organizations_url":"https://api.github.com/users/christopherthielen/orgs","repos_url":"https://api.github.com/users/christopherthielen/repos","events_url":"https://api.github.com/users/christopherthielen/events{/privacy}","received_events_url":"https://api.github.com/users/christopherthielen/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T20:03:40Z","updated_at":"2015-10-09T20:03:40Z","body":"Hi, ui-router-extras guy here.  Extras has code which keeps track of every `transitionTo` call, then matches that up with the `$stateChangeStart` event.  The problem here is that angular-permission is firing fake `$stateChangeStart` events, and that's causing the Extras code to bomb.\r\n\r\nI can add some logic in Extras that will work around the problem, but these two features ($transition$ and Previous States) will be incompatible with angular-permission, as long as it relies on fake ui-router events.\r\n\r\nNote that in 1.0 we've substantially improved the ui-router integration hooks making things like angular-permission much easier. "}}