payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/comments/299419931","pull_request_review_id":256811528,"id":299419931,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5OTQxOTkzMQ==","diff_hunk":"@@ -208,6 +216,18 @@ describe(\"questionnaire\", () => {\n       );\n       expect(oldestIndex > newestIndex).toEqual(true);\n     });\n+    it(\"should not list unaccessible private questionnaires\", async () => {\n+      const user = {\n+        id: \"123\",\n+      };\n+      await buildContext({}, user);","path":"eq-author-api/schema/tests/questionnaire.test.js","position":33,"original_position":33,"commit_id":"7ccf43e613c26339e2111b6b2f508ee69454ce36","original_commit_id":"7ccf43e613c26339e2111b6b2f508ee69454ce36","user":{"login":"tgandrews","id":180903,"node_id":"MDQ6VXNlcjE4MDkwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/180903?v=4","gravatar_id":"","url":"https://api.github.com/users/tgandrews","html_url":"https://github.com/tgandrews","followers_url":"https://api.github.com/users/tgandrews/followers","following_url":"https://api.github.com/users/tgandrews/following{/other_user}","gists_url":"https://api.github.com/users/tgandrews/gists{/gist_id}","starred_url":"https://api.github.com/users/tgandrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgandrews/subscriptions","organizations_url":"https://api.github.com/users/tgandrews/orgs","repos_url":"https://api.github.com/users/tgandrews/repos","events_url":"https://api.github.com/users/tgandrews/events{/privacy}","received_events_url":"https://api.github.com/users/tgandrews/received_events","type":"User","site_admin":false},"body":"I don't think we actually need to create these questionnaires","created_at":"2019-07-02T10:45:34Z","updated_at":"2019-07-02T10:45:35Z","html_url":"https://github.com/ONSdigital/eq-author-app/pull/431#discussion_r299419931","pull_request_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/comments/299419931"},"html":{"href":"https://github.com/ONSdigital/eq-author-app/pull/431#discussion_r299419931"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431","id":291572055,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkxNTcyMDU1","html_url":"https://github.com/ONSdigital/eq-author-app/pull/431","diff_url":"https://github.com/ONSdigital/eq-author-app/pull/431.diff","patch_url":"https://github.com/ONSdigital/eq-author-app/pull/431.patch","issue_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/431","number":431,"state":"open","locked":false,"title":"Make questionnaire public or private","user":{"login":"heofs","id":11583422,"node_id":"MDQ6VXNlcjExNTgzNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/11583422?v=4","gravatar_id":"","url":"https://api.github.com/users/heofs","html_url":"https://github.com/heofs","followers_url":"https://api.github.com/users/heofs/followers","following_url":"https://api.github.com/users/heofs/following{/other_user}","gists_url":"https://api.github.com/users/heofs/gists{/gist_id}","starred_url":"https://api.github.com/users/heofs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heofs/subscriptions","organizations_url":"https://api.github.com/users/heofs/orgs","repos_url":"https://api.github.com/users/heofs/repos","events_url":"https://api.github.com/users/heofs/events{/privacy}","received_events_url":"https://api.github.com/users/heofs/received_events","type":"User","site_admin":false},"body":"### What is the context of this PR?\r\n<https://trello.com/c/Z2mYhATn/1150-make-questionnaires-public-private-6>\r\nAdd the concept of public and private questionnaires. Users can only see a private questionnaire if they are an owner or an editor. Questionnaire is public by default, and can be set to private in the sharing modal.\r\n\r\n### How to review \r\nCheck that everything works as expected and the tests make sense.\r\n\r\n* Try opening a private questionnaire you dont have editor access on, you should be shown an unauthorized access page.\r\n* Try deleting yourself as editor, you should be shown an alert.\r\n","created_at":"2019-06-25T14:00:18Z","updated_at":"2019-07-02T10:45:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f901337dfc70089c55919131325bc4e0c99cca93","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/431/comments","statuses_url":"https://api.github.com/repos/ONSdigital/eq-author-app/statuses/7ccf43e613c26339e2111b6b2f508ee69454ce36","head":{"label":"ONSdigital:1150-make-questionnaires-public-private-6","ref":"1150-make-questionnaires-public-private-6","sha":"7ccf43e613c26339e2111b6b2f508ee69454ce36","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":157191578,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcxOTE1Nzg=","name":"eq-author-app","full_name":"ONSdigital/eq-author-app","private":false,"owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ONSdigital/eq-author-app","description":"An application for authoring eQ questionnaires.","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-author-app","forks_url":"https://api.github.com/repos/ONSdigital/eq-author-app/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-author-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-author-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-author-app/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-author-app/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-author-app/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-author-app/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-author-app/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-author-app/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-author-app/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-author-app/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-author-app/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-author-app/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-author-app/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-author-app/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-author-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-author-app/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-author-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-author-app/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-author-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-author-app/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-author-app/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-author-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-author-app/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-author-app/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/deployments","created_at":"2018-11-12T09:52:20Z","updated_at":"2019-07-02T10:32:12Z","pushed_at":"2019-07-02T10:32:09Z","git_url":"git://github.com/ONSdigital/eq-author-app.git","ssh_url":"git@github.com:ONSdigital/eq-author-app.git","clone_url":"https://github.com/ONSdigital/eq-author-app.git","svn_url":"https://github.com/ONSdigital/eq-author-app","homepage":null,"size":6666,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":35,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":35,"watchers":1,"default_branch":"master"}},"base":{"label":"ONSdigital:master","ref":"master","sha":"bc30c70edf63a2af21c366bc6a7254560c88d178","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":157191578,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcxOTE1Nzg=","name":"eq-author-app","full_name":"ONSdigital/eq-author-app","private":false,"owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ONSdigital/eq-author-app","description":"An application for authoring eQ questionnaires.","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-author-app","forks_url":"https://api.github.com/repos/ONSdigital/eq-author-app/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-author-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-author-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-author-app/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-author-app/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-author-app/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-author-app/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-author-app/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-author-app/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-author-app/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-author-app/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-author-app/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-author-app/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-author-app/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-author-app/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-author-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-author-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-author-app/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-author-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-author-app/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-author-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-author-app/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-author-app/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-author-app/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-author-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-author-app/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-author-app/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-author-app/deployments","created_at":"2018-11-12T09:52:20Z","updated_at":"2019-07-02T10:32:12Z","pushed_at":"2019-07-02T10:32:09Z","git_url":"git://github.com/ONSdigital/eq-author-app.git","ssh_url":"git@github.com:ONSdigital/eq-author-app.git","clone_url":"https://github.com/ONSdigital/eq-author-app.git","svn_url":"https://github.com/ONSdigital/eq-author-app","homepage":null,"size":6666,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":35,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":35,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431"},"html":{"href":"https://github.com/ONSdigital/eq-author-app/pull/431"},"issue":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/431"},"comments":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/issues/431/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/pulls/431/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/eq-author-app/statuses/7ccf43e613c26339e2111b6b2f508ee69454ce36"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"tgandrews"}}