{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/grid/issues/1806","repository_url":"https://api.github.com/repos/guardian/grid","labels_url":"https://api.github.com/repos/guardian/grid/issues/1806/labels{/name}","comments_url":"https://api.github.com/repos/guardian/grid/issues/1806/comments","events_url":"https://api.github.com/repos/guardian/grid/issues/1806/events","html_url":"https://github.com/guardian/grid/pull/1806","id":139866518,"number":1806,"title":"Expose user permissions","user":{"login":"kenoir","id":953792,"avatar_url":"https://avatars.githubusercontent.com/u/953792?v=3","gravatar_id":"","url":"https://api.github.com/users/kenoir","html_url":"https://github.com/kenoir","followers_url":"https://api.github.com/users/kenoir/followers","following_url":"https://api.github.com/users/kenoir/following{/other_user}","gists_url":"https://api.github.com/users/kenoir/gists{/gist_id}","starred_url":"https://api.github.com/users/kenoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenoir/subscriptions","organizations_url":"https://api.github.com/users/kenoir/orgs","repos_url":"https://api.github.com/users/kenoir/repos","events_url":"https://api.github.com/users/kenoir/events{/privacy}","received_events_url":"https://api.github.com/users/kenoir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-10T11:55:29Z","updated_at":"2016-03-18T11:21:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/guardian/grid/pulls/1806","html_url":"https://github.com/guardian/grid/pull/1806","diff_url":"https://github.com/guardian/grid/pull/1806.diff","patch_url":"https://github.com/guardian/grid/pull/1806.patch"},"body":"Expose permissions for current user in order to provide this info to the UI client so controls can be varied according to permissions.\r\n\r\nThis is specifically to add controls around paid imagery.\r\n\r\nExample response:\r\n\r\n`GET /permissions`\r\n\r\n```json\r\n{\r\n  \"data\": {\r\n    \"description\": \"Available permissions for current user (you)\",\r\n    \"permissionsSet\": {\r\n      \"user\": {\r\n        \"email\": \"nope@guardian.co.uk\",\r\n        \"firstName\": \"Robert\",\r\n        \"lastName\": \"Kenny\",\r\n        \"avatarUrl\": \"https://lh3.googleusercontent.com/nope/photo.jpg\"\r\n      },\r\n      \"permissions\": [\r\n        \"editMetadata\",\r\n        \"deleteImage\",\r\n        \"deleteCrops\",\r\n        \"bigSpender\"\r\n      ],\r\n      \"lastUpdated\": 1458298190366\r\n    }\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/guardian/grid/issues/comments/198313945","html_url":"https://github.com/guardian/grid/pull/1806#issuecomment-198313945","issue_url":"https://api.github.com/repos/guardian/grid/issues/1806","id":198313945,"user":{"login":"NickPapacostas","id":1441582,"avatar_url":"https://avatars.githubusercontent.com/u/1441582?v=3","gravatar_id":"","url":"https://api.github.com/users/NickPapacostas","html_url":"https://github.com/NickPapacostas","followers_url":"https://api.github.com/users/NickPapacostas/followers","following_url":"https://api.github.com/users/NickPapacostas/following{/other_user}","gists_url":"https://api.github.com/users/NickPapacostas/gists{/gist_id}","starred_url":"https://api.github.com/users/NickPapacostas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickPapacostas/subscriptions","organizations_url":"https://api.github.com/users/NickPapacostas/orgs","repos_url":"https://api.github.com/users/NickPapacostas/repos","events_url":"https://api.github.com/users/NickPapacostas/events{/privacy}","received_events_url":"https://api.github.com/users/NickPapacostas/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T11:21:38Z","updated_at":"2016-03-18T11:21:38Z","body":":+1: "}}