{"action":"created","issue":{"url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/5","repository_url":"https://api.github.com/repos/Ruscount/HRExpert.UI","labels_url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/5/comments","events_url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/5/events","html_url":"https://github.com/Ruscount/HRExpert.UI/issues/5","id":165976521,"number":5,"title":"Роли","user":{"login":"qwsazxc88","id":16289598,"avatar_url":"https://avatars.githubusercontent.com/u/16289598?v=3","gravatar_id":"","url":"https://api.github.com/users/qwsazxc88","html_url":"https://github.com/qwsazxc88","followers_url":"https://api.github.com/users/qwsazxc88/followers","following_url":"https://api.github.com/users/qwsazxc88/following{/other_user}","gists_url":"https://api.github.com/users/qwsazxc88/gists{/gist_id}","starred_url":"https://api.github.com/users/qwsazxc88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwsazxc88/subscriptions","organizations_url":"https://api.github.com/users/qwsazxc88/orgs","repos_url":"https://api.github.com/users/qwsazxc88/repos","events_url":"https://api.github.com/users/qwsazxc88/events{/privacy}","received_events_url":"https://api.github.com/users/qwsazxc88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-17T13:22:40Z","updated_at":"2016-07-18T06:47:27Z","closed_at":null,"body":"Я думаю надо полностью отказаться от ролей в пользу токенов\r\nПри авторизации сервер возвращает объект `Profile`\r\n\r\n```typescript\r\ninterface Profile {\r\n    username: string;\r\n    tokens: Token[];\r\n// Текущий роли из Reports сохранятся как шаблоны токенов\r\n// в углу dropdown с выбором текущего токена\r\n}\r\n// При получении декодировать токен в структуру\r\ninterface Token {\r\n    rolename: string; // имя роли на сервере для отображения текущей роли\r\n    token: string; // сам токен (для запрсов с его участием)\r\n    // при получении его payload  декодируется в \r\n    sections: Sections;\r\n}\r\ninterface Sections {\r\n    global: Permissions; // глобальные разрешения (не уверен что они нужны)\r\n    organizations? : Permissions; // разрешения в каждой категории сайта\r\n    sicklist?: Permissions;\r\n    ...\r\n}\r\n/**\r\n * строка с разделителем с названиями разрешений и методы для работы с ней\r\n **/ \r\nclass Permissions {\r\n/** можно использоавть маски вида \"*\" или \"* ^view-email\" (разрешено всё кроме просмотра email) **/\r\n    private perms: string;\r\n    isAllowed (permission: string) : boolean;\r\n}\r\n```\r\nПри навигации роутер через [resolve](https://angular.io/docs/ts/latest/api/router/index/Resolve-interface.html) будет подтягивать разрешения для текущей секции"},"comment":{"url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/comments/233245750","html_url":"https://github.com/Ruscount/HRExpert.UI/issues/5#issuecomment-233245750","issue_url":"https://api.github.com/repos/Ruscount/HRExpert.UI/issues/5","id":233245750,"user":{"login":"artemb89","id":8859903,"avatar_url":"https://avatars.githubusercontent.com/u/8859903?v=3","gravatar_id":"","url":"https://api.github.com/users/artemb89","html_url":"https://github.com/artemb89","followers_url":"https://api.github.com/users/artemb89/followers","following_url":"https://api.github.com/users/artemb89/following{/other_user}","gists_url":"https://api.github.com/users/artemb89/gists{/gist_id}","starred_url":"https://api.github.com/users/artemb89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemb89/subscriptions","organizations_url":"https://api.github.com/users/artemb89/orgs","repos_url":"https://api.github.com/users/artemb89/repos","events_url":"https://api.github.com/users/artemb89/events{/privacy}","received_events_url":"https://api.github.com/users/artemb89/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T06:47:27Z","updated_at":"2016-07-18T06:47:27Z","body":"Как будешь на работе - обсудим"}}
{"actor":{"display_login":"artemb89"}}