{"action":"created","issue":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/790","repository_url":"https://api.github.com/repos/mitodl/micromasters","labels_url":"https://api.github.com/repos/mitodl/micromasters/issues/790/labels{/name}","comments_url":"https://api.github.com/repos/mitodl/micromasters/issues/790/comments","events_url":"https://api.github.com/repos/mitodl/micromasters/issues/790/events","html_url":"https://github.com/mitodl/micromasters/pull/790","id":169161486,"number":790,"title":"Enforced permissions on profiles REST API","user":{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitodl/micromasters/labels/Needs%20Review","name":"Needs Review","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"giocalitri","id":1005204,"avatar_url":"https://avatars.githubusercontent.com/u/1005204?v=3","gravatar_id":"","url":"https://api.github.com/users/giocalitri","html_url":"https://github.com/giocalitri","followers_url":"https://api.github.com/users/giocalitri/followers","following_url":"https://api.github.com/users/giocalitri/following{/other_user}","gists_url":"https://api.github.com/users/giocalitri/gists{/gist_id}","starred_url":"https://api.github.com/users/giocalitri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giocalitri/subscriptions","organizations_url":"https://api.github.com/users/giocalitri/orgs","repos_url":"https://api.github.com/users/giocalitri/repos","events_url":"https://api.github.com/users/giocalitri/events{/privacy}","received_events_url":"https://api.github.com/users/giocalitri/received_events","type":"User","site_admin":false},"assignees":[{"login":"giocalitri","id":1005204,"avatar_url":"https://avatars.githubusercontent.com/u/1005204?v=3","gravatar_id":"","url":"https://api.github.com/users/giocalitri","html_url":"https://github.com/giocalitri","followers_url":"https://api.github.com/users/giocalitri/followers","following_url":"https://api.github.com/users/giocalitri/following{/other_user}","gists_url":"https://api.github.com/users/giocalitri/gists{/gist_id}","starred_url":"https://api.github.com/users/giocalitri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giocalitri/subscriptions","organizations_url":"https://api.github.com/users/giocalitri/orgs","repos_url":"https://api.github.com/users/giocalitri/repos","events_url":"https://api.github.com/users/giocalitri/events{/privacy}","received_events_url":"https://api.github.com/users/giocalitri/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-08-03T15:30:24Z","updated_at":"2016-08-03T19:16:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mitodl/micromasters/pulls/790","html_url":"https://github.com/mitodl/micromasters/pull/790","diff_url":"https://github.com/mitodl/micromasters/pull/790.diff","patch_url":"https://github.com/mitodl/micromasters/pull/790.patch"},"body":"#### What are the relevant tickets?\r\nFixes #89 \r\n\r\n#### What's this PR do?\r\nEnforces permissions on the profiles API\r\n\r\n#### Where should the reviewer start?\r\nprofiles/permissions.py\r\n\r\n#### How should this be manually tested?\r\nCreate two users and a program if necessary. One user should have `account_privacy` set to private and be assigned to the program in the `ProgramEnrollment` model. The other user should have an instructor or staff role added for the same program using the `Role` model.\r\n\r\nLog in as the instructor or staff, then view the profile of the other user by going to `/api/v0/profiles/username/`. You should see everything that that user can see for their own profile. For example you should see `agreed_to_terms_of_service` which is not shown even in public profiles to other students.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/comments/237341822","html_url":"https://github.com/mitodl/micromasters/pull/790#issuecomment-237341822","issue_url":"https://api.github.com/repos/mitodl/micromasters/issues/790","id":237341822,"user":{"login":"giocalitri","id":1005204,"avatar_url":"https://avatars.githubusercontent.com/u/1005204?v=3","gravatar_id":"","url":"https://api.github.com/users/giocalitri","html_url":"https://github.com/giocalitri","followers_url":"https://api.github.com/users/giocalitri/followers","following_url":"https://api.github.com/users/giocalitri/following{/other_user}","gists_url":"https://api.github.com/users/giocalitri/gists{/gist_id}","starred_url":"https://api.github.com/users/giocalitri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giocalitri/subscriptions","organizations_url":"https://api.github.com/users/giocalitri/orgs","repos_url":"https://api.github.com/users/giocalitri/repos","events_url":"https://api.github.com/users/giocalitri/events{/privacy}","received_events_url":"https://api.github.com/users/giocalitri/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T19:16:02Z","updated_at":"2016-08-03T19:16:02Z","body":"A couple of minor comments but overall good"}}
{"actor":{"display_login":"giocalitri"}}