{"action":"created","issue":{"url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/220","labels_url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/220/comments","events_url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/220/events","html_url":"https://github.com/policycompass/policycompass-frontend/pull/220","id":113845508,"number":220,"title":"2015 10 mn edit button","user":{"login":"MagdaN","id":2905743,"avatar_url":"https://avatars.githubusercontent.com/u/2905743?v=3","gravatar_id":"","url":"https://api.github.com/users/MagdaN","html_url":"https://github.com/MagdaN","followers_url":"https://api.github.com/users/MagdaN/followers","following_url":"https://api.github.com/users/MagdaN/following{/other_user}","gists_url":"https://api.github.com/users/MagdaN/gists{/gist_id}","starred_url":"https://api.github.com/users/MagdaN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MagdaN/subscriptions","organizations_url":"https://api.github.com/users/MagdaN/orgs","repos_url":"https://api.github.com/users/MagdaN/repos","events_url":"https://api.github.com/users/MagdaN/events{/privacy}","received_events_url":"https://api.github.com/users/MagdaN/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-10-28T15:18:50Z","updated_at":"2015-11-04T08:41:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/policycompass/policycompass-frontend/pulls/220","html_url":"https://github.com/policycompass/policycompass-frontend/pull/220","diff_url":"https://github.com/policycompass/policycompass-frontend/pull/220.diff","patch_url":"https://github.com/policycompass/policycompass-frontend/pull/220.patch"},"body":"OK, I added a simple directive that will show an edit and an delete button when the user is admin or creator of a resource. I assume that the buttons are added on the detail page of a resource and that the creator is known (means in scope) of that page. You can add the buttons like that:\r\n\r\n```\r\n<edit-buttons \r\ndata-userpath=\"{{ data.creator_path }}\" \r\ndata-editurl=\"#!/metrics/{{data.id}}/edit\"                \r\ndata-deletefunction=\"delete\">\r\n</edit-buttons>\r\n```\r\n\r\n*  data-userpath is the creator of the resource (should be a path),\r\n*  data-editurl is the url where the edit button should link to\r\n*  deletefunction is the function from the surrounding scope that is called when clicking the 'delete' button "},"comment":{"url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/comments/153637447","html_url":"https://github.com/policycompass/policycompass-frontend/pull/220#issuecomment-153637447","issue_url":"https://api.github.com/repos/policycompass/policycompass-frontend/issues/220","id":153637447,"user":{"login":"FabiApfelkern","id":1488424,"avatar_url":"https://avatars.githubusercontent.com/u/1488424?v=3","gravatar_id":"","url":"https://api.github.com/users/FabiApfelkern","html_url":"https://github.com/FabiApfelkern","followers_url":"https://api.github.com/users/FabiApfelkern/followers","following_url":"https://api.github.com/users/FabiApfelkern/following{/other_user}","gists_url":"https://api.github.com/users/FabiApfelkern/gists{/gist_id}","starred_url":"https://api.github.com/users/FabiApfelkern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FabiApfelkern/subscriptions","organizations_url":"https://api.github.com/users/FabiApfelkern/orgs","repos_url":"https://api.github.com/users/FabiApfelkern/repos","events_url":"https://api.github.com/users/FabiApfelkern/events{/privacy}","received_events_url":"https://api.github.com/users/FabiApfelkern/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T08:41:34Z","updated_at":"2015-11-04T08:41:34Z","body":"I would say we keep everything as it is for now. But lets discuss later again in the telco. I merge this for now. "}}