{"action":"closed","number":3,"pull_request":{"url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3","id":83096200,"html_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api/pull/3","diff_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api/pull/3.diff","patch_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api/pull/3.patch","issue_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/3","number":3,"state":"closed","locked":false,"title":"Task 7 ensure that only admins can create rooms","user":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"body":"Ensured that only admins can create rooms, added respecting @PreAuthorize annotation arguments. I also modified DataLoader class, by adding pre-authorized admin user to create couple of rooms before application starts. I changed CustomUserDetailsService so that \"our\" user is returned if we ever call `authentication.principal` in @PreAuthorize. Hope that will help. Also List<User> administrators was added as member variable to Room class. And now User class implements UserDetails, just in case we want to cast `authenticate.principal` to User and check stuff here or there.","created_at":"2016-08-29T13:10:24Z","updated_at":"2016-08-29T13:10:32Z","closed_at":"2016-08-29T13:10:32Z","merged_at":"2016-08-29T13:10:32Z","merge_commit_sha":"dbfbba14eaf5033279da6a4a75f1118706f2f85f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3/commits","review_comments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3/comments","review_comment_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/3/comments","statuses_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/statuses/16a6a0c1c8227382222e040f98ef899ed9832162","head":{"label":"nikiforov-alexander:task-7-ensure-that-only-admins-can-create-rooms","ref":"task-7-ensure-that-only-admins-can-create-rooms","sha":"16a6a0c1c8227382222e040f98ef899ed9832162","user":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"repo":{"id":66027374,"name":"pt10-home-automation-spring-rest-api","full_name":"nikiforov-alexander/pt10-home-automation-spring-rest-api","owner":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api","description":"Techdegree Java Web Development Project 10 - REST API in Spring: Home Automation","fork":false,"url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api","forks_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/forks","keys_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/teams","hooks_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/hooks","issue_events_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/events{/number}","events_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/events","assignees_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/assignees{/user}","branches_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/branches{/branch}","tags_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/tags","blobs_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/statuses/{sha}","languages_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/languages","stargazers_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/stargazers","contributors_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/contributors","subscribers_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/subscribers","subscription_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/subscription","commits_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/contents/{+path}","compare_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/merges","archive_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/downloads","issues_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues{/number}","pulls_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls{/number}","milestones_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/milestones{/number}","notifications_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/labels{/name}","releases_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/releases{/id}","deployments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/deployments","created_at":"2016-08-18T20:10:57Z","updated_at":"2016-08-19T08:37:28Z","pushed_at":"2016-08-29T13:10:32Z","git_url":"git://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api.git","ssh_url":"git@github.com:nikiforov-alexander/pt10-home-automation-spring-rest-api.git","clone_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api.git","svn_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api","homepage":"","size":2223,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nikiforov-alexander:master","ref":"master","sha":"8e52e15fe7fc74aa1cd105d1307a7a6bfaed1d31","user":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"repo":{"id":66027374,"name":"pt10-home-automation-spring-rest-api","full_name":"nikiforov-alexander/pt10-home-automation-spring-rest-api","owner":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api","description":"Techdegree Java Web Development Project 10 - REST API in Spring: Home Automation","fork":false,"url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api","forks_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/forks","keys_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/teams","hooks_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/hooks","issue_events_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/events{/number}","events_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/events","assignees_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/assignees{/user}","branches_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/branches{/branch}","tags_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/tags","blobs_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/statuses/{sha}","languages_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/languages","stargazers_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/stargazers","contributors_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/contributors","subscribers_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/subscribers","subscription_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/subscription","commits_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/contents/{+path}","compare_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/merges","archive_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/downloads","issues_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues{/number}","pulls_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls{/number}","milestones_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/milestones{/number}","notifications_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/labels{/name}","releases_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/releases{/id}","deployments_url":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/deployments","created_at":"2016-08-18T20:10:57Z","updated_at":"2016-08-19T08:37:28Z","pushed_at":"2016-08-29T13:10:32Z","git_url":"git://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api.git","ssh_url":"git@github.com:nikiforov-alexander/pt10-home-automation-spring-rest-api.git","clone_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api.git","svn_url":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api","homepage":"","size":2223,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3"},"html":{"href":"https://github.com/nikiforov-alexander/pt10-home-automation-spring-rest-api/pull/3"},"issue":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/3"},"comments":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/nikiforov-alexander/pt10-home-automation-spring-rest-api/statuses/16a6a0c1c8227382222e040f98ef899ed9832162"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"nikiforov-alexander","id":19283810,"avatar_url":"https://avatars.githubusercontent.com/u/19283810?v=3","gravatar_id":"","url":"https://api.github.com/users/nikiforov-alexander","html_url":"https://github.com/nikiforov-alexander","followers_url":"https://api.github.com/users/nikiforov-alexander/followers","following_url":"https://api.github.com/users/nikiforov-alexander/following{/other_user}","gists_url":"https://api.github.com/users/nikiforov-alexander/gists{/gist_id}","starred_url":"https://api.github.com/users/nikiforov-alexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikiforov-alexander/subscriptions","organizations_url":"https://api.github.com/users/nikiforov-alexander/orgs","repos_url":"https://api.github.com/users/nikiforov-alexander/repos","events_url":"https://api.github.com/users/nikiforov-alexander/events{/privacy}","received_events_url":"https://api.github.com/users/nikiforov-alexander/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":15,"additions":1526,"deletions":24,"changed_files":18}}
{"actor":{"display_login":"nikiforov-alexander"}}