{"action":"opened","number":91,"pull_request":{"url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91","id":223673354,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjczMzU0","html_url":"https://github.com/UKHomeOffice/asl-service/pull/91","diff_url":"https://github.com/UKHomeOffice/asl-service/pull/91.diff","patch_url":"https://github.com/UKHomeOffice/asl-service/pull/91.patch","issue_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/91","number":91,"state":"open","locked":false,"title":"Add `allowedActions` method to user","user":{"login":"lennym","id":117398,"node_id":"MDQ6VXNlcjExNzM5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/117398?v=4","gravatar_id":"","url":"https://api.github.com/users/lennym","html_url":"https://github.com/lennym","followers_url":"https://api.github.com/users/lennym/followers","following_url":"https://api.github.com/users/lennym/following{/other_user}","gists_url":"https://api.github.com/users/lennym/gists{/gist_id}","starred_url":"https://api.github.com/users/lennym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lennym/subscriptions","organizations_url":"https://api.github.com/users/lennym/orgs","repos_url":"https://api.github.com/users/lennym/repos","events_url":"https://api.github.com/users/lennym/events{/privacy}","received_events_url":"https://api.github.com/users/lennym/received_events","type":"User","site_admin":false},"body":"Instead of overloading the `can` function to do different things in different contexts, instead create a separate method for getting the actions allowed by the logged in user.","created_at":"2018-10-17T16:34:01Z","updated_at":"2018-10-17T16:34:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91/commits","review_comments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91/comments","review_comment_url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/91/comments","statuses_url":"https://api.github.com/repos/UKHomeOffice/asl-service/statuses/bbb6d68e409f3b9057751af95ac2dd505a8a0a61","head":{"label":"UKHomeOffice:feature/allowed-actions","ref":"feature/allowed-actions","sha":"bbb6d68e409f3b9057751af95ac2dd505a8a0a61","user":{"login":"UKHomeOffice","id":3778081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzgwODE=","avatar_url":"https://avatars2.githubusercontent.com/u/3778081?v=4","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":118924369,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5MjQzNjk=","name":"asl-service","full_name":"UKHomeOffice/asl-service","private":false,"owner":{"login":"UKHomeOffice","id":3778081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzgwODE=","avatar_url":"https://avatars2.githubusercontent.com/u/3778081?v=4","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UKHomeOffice/asl-service","description":null,"fork":false,"url":"https://api.github.com/repos/UKHomeOffice/asl-service","forks_url":"https://api.github.com/repos/UKHomeOffice/asl-service/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/asl-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/asl-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/asl-service/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/asl-service/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/asl-service/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/asl-service/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/asl-service/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/asl-service/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/asl-service/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/asl-service/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/asl-service/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/asl-service/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/asl-service/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/asl-service/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/asl-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/asl-service/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/asl-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/asl-service/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/asl-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/asl-service/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/asl-service/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/asl-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/asl-service/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/asl-service/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/deployments","created_at":"2018-01-25T14:38:05Z","updated_at":"2018-10-10T15:02:14Z","pushed_at":"2018-10-17T16:33:55Z","git_url":"git://github.com/UKHomeOffice/asl-service.git","ssh_url":"git@github.com:UKHomeOffice/asl-service.git","clone_url":"https://github.com/UKHomeOffice/asl-service.git","svn_url":"https://github.com/UKHomeOffice/asl-service","homepage":null,"size":1351,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"UKHomeOffice:master","ref":"master","sha":"7c04fede4078b5e522c9aaf2fa33a35b0c798e12","user":{"login":"UKHomeOffice","id":3778081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzgwODE=","avatar_url":"https://avatars2.githubusercontent.com/u/3778081?v=4","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":118924369,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5MjQzNjk=","name":"asl-service","full_name":"UKHomeOffice/asl-service","private":false,"owner":{"login":"UKHomeOffice","id":3778081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzgwODE=","avatar_url":"https://avatars2.githubusercontent.com/u/3778081?v=4","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UKHomeOffice/asl-service","description":null,"fork":false,"url":"https://api.github.com/repos/UKHomeOffice/asl-service","forks_url":"https://api.github.com/repos/UKHomeOffice/asl-service/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/asl-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/asl-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/asl-service/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/asl-service/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/asl-service/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/asl-service/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/asl-service/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/asl-service/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/asl-service/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/asl-service/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/asl-service/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/asl-service/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/asl-service/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/asl-service/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/asl-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/asl-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/asl-service/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/asl-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/asl-service/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/asl-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/asl-service/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/asl-service/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/asl-service/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/asl-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/asl-service/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/asl-service/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/asl-service/deployments","created_at":"2018-01-25T14:38:05Z","updated_at":"2018-10-10T15:02:14Z","pushed_at":"2018-10-17T16:33:55Z","git_url":"git://github.com/UKHomeOffice/asl-service.git","ssh_url":"git@github.com:UKHomeOffice/asl-service.git","clone_url":"https://github.com/UKHomeOffice/asl-service.git","svn_url":"https://github.com/UKHomeOffice/asl-service","homepage":null,"size":1351,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91"},"html":{"href":"https://github.com/UKHomeOffice/asl-service/pull/91"},"issue":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/91"},"comments":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/UKHomeOffice/asl-service/statuses/bbb6d68e409f3b9057751af95ac2dd505a8a0a61"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":7,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"lennym"}}