{"action":"created","comment":{"url":"https://api.github.com/repos/andela/metis-ah/pulls/comments/224067259","pull_request_review_id":163343894,"id":224067259,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDA2NzI1OQ==","diff_hunk":"@@ -0,0 +1,23 @@\n+import dotenv from 'dotenv';\n+import model from '../models';","path":"server/scripts/admin.js","position":2,"original_position":2,"commit_id":"9fe9af14d59374fdc4e2cd4fa10183d6be3fbf4a","original_commit_id":"9fe9af14d59374fdc4e2cd4fa10183d6be3fbf4a","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Missing file extension for \"../models\"  import/extensions","created_at":"2018-10-10T13:08:07Z","updated_at":"2018-10-10T13:08:09Z","html_url":"https://github.com/andela/metis-ah/pull/31#discussion_r224067259","pull_request_url":"https://api.github.com/repos/andela/metis-ah/pulls/31","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/comments/224067259"},"html":{"href":"https://github.com/andela/metis-ah/pull/31#discussion_r224067259"},"pull_request":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/andela/metis-ah/pulls/31","id":217190657,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MTkwNjU3","html_url":"https://github.com/andela/metis-ah/pull/31","diff_url":"https://github.com/andela/metis-ah/pull/31.diff","patch_url":"https://github.com/andela/metis-ah/pull/31.patch","issue_url":"https://api.github.com/repos/andela/metis-ah/issues/31","number":31,"state":"open","locked":false,"title":"#159987421 role based access","user":{"login":"IyiKuyoro","id":30635021,"node_id":"MDQ6VXNlcjMwNjM1MDIx","avatar_url":"https://avatars1.githubusercontent.com/u/30635021?v=4","gravatar_id":"","url":"https://api.github.com/users/IyiKuyoro","html_url":"https://github.com/IyiKuyoro","followers_url":"https://api.github.com/users/IyiKuyoro/followers","following_url":"https://api.github.com/users/IyiKuyoro/following{/other_user}","gists_url":"https://api.github.com/users/IyiKuyoro/gists{/gist_id}","starred_url":"https://api.github.com/users/IyiKuyoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IyiKuyoro/subscriptions","organizations_url":"https://api.github.com/users/IyiKuyoro/orgs","repos_url":"https://api.github.com/users/IyiKuyoro/repos","events_url":"https://api.github.com/users/IyiKuyoro/events{/privacy}","received_events_url":"https://api.github.com/users/IyiKuyoro/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nImplements a role-based access control to routes\r\n#### Description of Task to be completed?\r\n- Create the `roles` model\r\n- Add a `roleId` field to the user's table and establish a relationship with `roles`\r\n- Create the following endpoints\r\n  * `[GET] All roles`\r\n  * `[POST] New role`\r\n  * `[PUT] Edit role`\r\n- Add middleware that checks role access to various routes\r\n- Updates the documentation\r\n#### How should this be manually tested?\r\n1. Clone the repository.\r\n2. Checkout the `ft-role-based-access-159987421` branch.\r\n3. Run npm install on your local machine.\r\n4. Run the following commands \r\n```export NODE_ENV=development\r\nexport DATABASE_URL=(Your-Local-DB-URL)\r\nexport TEST_DATABASE_URL=(Your-Local-Test-DB-URL)\r\nnpm run migrate\r\n```\r\n5. Start the server using `npm run start_dev`.\r\n6. Sigin up and try to access `localhost:8000/api/v1/cases`.\r\n7. You should get a `401` response with a `Only an admin can access this resource`\r\n#### What are the relevant pivotal tracker stories?\r\n#159987421","created_at":"2018-09-21T07:09:31Z","updated_at":"2018-10-10T13:08:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edc76ec793592027f39ddb1f469f2c5817825c11","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/metis-ah/pulls/31/commits","review_comments_url":"https://api.github.com/repos/andela/metis-ah/pulls/31/comments","review_comment_url":"https://api.github.com/repos/andela/metis-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/metis-ah/issues/31/comments","statuses_url":"https://api.github.com/repos/andela/metis-ah/statuses/9fe9af14d59374fdc4e2cd4fa10183d6be3fbf4a","head":{"label":"andela:ft-role-based-access-159987421","ref":"ft-role-based-access-159987421","sha":"9fe9af14d59374fdc4e2cd4fa10183d6be3fbf4a","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145832105,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzIxMDU=","name":"metis-ah","full_name":"andela/metis-ah","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/metis-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/metis-ah","forks_url":"https://api.github.com/repos/andela/metis-ah/forks","keys_url":"https://api.github.com/repos/andela/metis-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/metis-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/metis-ah/teams","hooks_url":"https://api.github.com/repos/andela/metis-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/metis-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/metis-ah/events","assignees_url":"https://api.github.com/repos/andela/metis-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/metis-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/metis-ah/tags","blobs_url":"https://api.github.com/repos/andela/metis-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/metis-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/metis-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/metis-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/metis-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/metis-ah/languages","stargazers_url":"https://api.github.com/repos/andela/metis-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/metis-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/metis-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/metis-ah/subscription","commits_url":"https://api.github.com/repos/andela/metis-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/metis-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/metis-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/metis-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/metis-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/metis-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/metis-ah/merges","archive_url":"https://api.github.com/repos/andela/metis-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/metis-ah/downloads","issues_url":"https://api.github.com/repos/andela/metis-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/metis-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/metis-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/metis-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/metis-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/metis-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/metis-ah/deployments","created_at":"2018-08-23T09:33:02Z","updated_at":"2018-10-09T11:32:25Z","pushed_at":"2018-10-10T13:07:49Z","git_url":"git://github.com/andela/metis-ah.git","ssh_url":"git@github.com:andela/metis-ah.git","clone_url":"https://github.com/andela/metis-ah.git","svn_url":"https://github.com/andela/metis-ah","homepage":null,"size":1645,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":0,"open_issues":11,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"ab3cec0b961cd5a85e7eb70bd78063d4083cf254","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145832105,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzIxMDU=","name":"metis-ah","full_name":"andela/metis-ah","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/metis-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/metis-ah","forks_url":"https://api.github.com/repos/andela/metis-ah/forks","keys_url":"https://api.github.com/repos/andela/metis-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/metis-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/metis-ah/teams","hooks_url":"https://api.github.com/repos/andela/metis-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/metis-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/metis-ah/events","assignees_url":"https://api.github.com/repos/andela/metis-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/metis-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/metis-ah/tags","blobs_url":"https://api.github.com/repos/andela/metis-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/metis-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/metis-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/metis-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/metis-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/metis-ah/languages","stargazers_url":"https://api.github.com/repos/andela/metis-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/metis-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/metis-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/metis-ah/subscription","commits_url":"https://api.github.com/repos/andela/metis-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/metis-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/metis-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/metis-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/metis-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/metis-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/metis-ah/merges","archive_url":"https://api.github.com/repos/andela/metis-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/metis-ah/downloads","issues_url":"https://api.github.com/repos/andela/metis-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/metis-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/metis-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/metis-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/metis-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/metis-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/metis-ah/deployments","created_at":"2018-08-23T09:33:02Z","updated_at":"2018-10-09T11:32:25Z","pushed_at":"2018-10-10T13:07:49Z","git_url":"git://github.com/andela/metis-ah.git","ssh_url":"git@github.com:andela/metis-ah.git","clone_url":"https://github.com/andela/metis-ah.git","svn_url":"https://github.com/andela/metis-ah","homepage":null,"size":1645,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":0,"open_issues":11,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/31"},"html":{"href":"https://github.com/andela/metis-ah/pull/31"},"issue":{"href":"https://api.github.com/repos/andela/metis-ah/issues/31"},"comments":{"href":"https://api.github.com/repos/andela/metis-ah/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/metis-ah/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/andela/metis-ah/statuses/9fe9af14d59374fdc4e2cd4fa10183d6be3fbf4a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}