{"action":"created","issue":{"url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/78","repository_url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend","labels_url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/78/comments","events_url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/78/events","html_url":"https://github.com/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pull/78","id":369801814,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjQ5ODg2","number":78,"title":"Permission","user":{"login":"chk1994","id":19282606,"node_id":"MDQ6VXNlcjE5MjgyNjA2","avatar_url":"https://avatars0.githubusercontent.com/u/19282606?v=4","gravatar_id":"","url":"https://api.github.com/users/chk1994","html_url":"https://github.com/chk1994","followers_url":"https://api.github.com/users/chk1994/followers","following_url":"https://api.github.com/users/chk1994/following{/other_user}","gists_url":"https://api.github.com/users/chk1994/gists{/gist_id}","starred_url":"https://api.github.com/users/chk1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chk1994/subscriptions","organizations_url":"https://api.github.com/users/chk1994/orgs","repos_url":"https://api.github.com/users/chk1994/repos","events_url":"https://api.github.com/users/chk1994/events{/privacy}","received_events_url":"https://api.github.com/users/chk1994/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-13T13:22:18Z","updated_at":"2018-10-15T02:17:11Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pulls/78","html_url":"https://github.com/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pull/78","diff_url":"https://github.com/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pull/78.diff","patch_url":"https://github.com/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pull/78.patch"},"body":"Implemented Many to Many mapping by adding Permission model which have the following attributes (Record record, User user, Instant expiryDateTime, String patientNric)\r\n- User here refers to Therapist who has been granted permission\r\n- patientNric refers to the patient who gave the permission\r\n\r\n@RequestMapping(\"/api/permissions\")\r\nMethods implemented:\r\n\r\n1. grantPermission(PermissionRequest permissionRequest, CurrentUser UserPrincipal currentUser)\r\n@PostMapping(\"/permit/\")\r\n- users can only grant records belonging to them\r\n- Granted permission length is capped at 24months each time. So patients cant anyhow grant indefinitely\r\n\r\n2. revokePermission(PermissionRequest permissionRequest, CurrentUser UserPrincipal currentUser)\r\n@PostMapping(\"/revoke/\")\r\n- users can only revoke records belonging to them & permission has been granted\r\n\r\n3. getAllowedRecords(@CurrentUser UserPrincipal currentUser)\r\n@GetMapping(\"/therapist/allowed/\")\r\n- User can see records permitted to them if their currentUser.getNric = therapist Nric\r\n- list of all records they have been given permission\r\n\r\n4. getGivenRecords(@CurrentUser UserPrincipal currentUser)\r\n@GetMapping(\"/patient/given/\")\r\n- User can see records permitted to them if their currentUser.getNric = patient Nric\r\n- list of all records they have given permission\r\n\r\nFuture implementation \r\n- Patient should also be able to see which therapist they permitted the records to, instead of only seeing which records were given permission under method 4 (this one I missed out ps)\r\n- automatic revocation of permission when expired\r\n"},"comment":{"url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/comments/429688231","html_url":"https://github.com/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/pull/78#issuecomment-429688231","issue_url":"https://api.github.com/repos/IFS4205-2018-Sem1-Team1/protect-PM-Lee-frontend/issues/78","id":429688231,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTY4ODIzMQ==","user":{"login":"Zhiyuan-Amos","id":19281514,"node_id":"MDQ6VXNlcjE5MjgxNTE0","avatar_url":"https://avatars3.githubusercontent.com/u/19281514?v=4","gravatar_id":"","url":"https://api.github.com/users/Zhiyuan-Amos","html_url":"https://github.com/Zhiyuan-Amos","followers_url":"https://api.github.com/users/Zhiyuan-Amos/followers","following_url":"https://api.github.com/users/Zhiyuan-Amos/following{/other_user}","gists_url":"https://api.github.com/users/Zhiyuan-Amos/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhiyuan-Amos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhiyuan-Amos/subscriptions","organizations_url":"https://api.github.com/users/Zhiyuan-Amos/orgs","repos_url":"https://api.github.com/users/Zhiyuan-Amos/repos","events_url":"https://api.github.com/users/Zhiyuan-Amos/events{/privacy}","received_events_url":"https://api.github.com/users/Zhiyuan-Amos/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T02:17:11Z","updated_at":"2018-10-15T02:17:11Z","author_association":"MEMBER","body":"@chk1994 take note to state which issues your PR fix. I've updated your 1st comment (scroll all the way up), do take note in the future."}}
{"actor":{"display_login":"Zhiyuan-Amos"}}