{"action":"opened","issue":{"url":"https://api.github.com/repos/Narzerus/angular-permission/issues/316","repository_url":"https://api.github.com/repos/Narzerus/angular-permission","labels_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/316/comments","events_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/316/events","html_url":"https://github.com/Narzerus/angular-permission/issues/316","id":171324426,"number":316,"title":"Problem with defining permissions in Restangular promises","user":{"login":"mahmoudmy","id":5320237,"avatar_url":"https://avatars.githubusercontent.com/u/5320237?v=3","gravatar_id":"","url":"https://api.github.com/users/mahmoudmy","html_url":"https://github.com/mahmoudmy","followers_url":"https://api.github.com/users/mahmoudmy/followers","following_url":"https://api.github.com/users/mahmoudmy/following{/other_user}","gists_url":"https://api.github.com/users/mahmoudmy/gists{/gist_id}","starred_url":"https://api.github.com/users/mahmoudmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahmoudmy/subscriptions","organizations_url":"https://api.github.com/users/mahmoudmy/orgs","repos_url":"https://api.github.com/users/mahmoudmy/repos","events_url":"https://api.github.com/users/mahmoudmy/events{/privacy}","received_events_url":"https://api.github.com/users/mahmoudmy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-16T04:51:22Z","updated_at":"2016-08-16T04:51:22Z","closed_at":null,"body":"I use [Restangular](https://github.com/mgonto/restangular) for getting user information and permissions from server, so I need to define permissions in the promisses:\r\n```\r\nangular.module('myApp')\r\n    .run(function(Restangular, PermPermissionStore) {\r\n      Restangular.one('user').get().then(function(response) {\r\n         PermPermissionStore.defineManyPermissions(response.perms, function(permissionName) {\r\n           return _.includes(response.perms, permissionName);\r\n         });\r\n       });\r\n });\r\n```\r\nBut this doesn't work fine some times!"}}
{"actor":{"display_login":"mahmoudmy"}}