{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/comments/29618730","id":29618730,"diff_hunk":"@@ -48,6 +48,22 @@\n         </collection>\n     </resultMap>\n \n+    <insert id=\"createThread\" parameterType=\"com.wikia.discussionservice.domain.ForumThread\"\n+            keyProperty=\"thread.id\">\n+        INSERT INTO thread (\n+        id, site_id, title, created_by, container_type, container_id, post_count, first_post_id,\n+        last_post_id\n+        )\n+        VALUES (\n+        0, <!-- we specify zero because column is non-null.  sproc will replace with GUID -->\n+        #{siteId}, #{title}, #{creatorId}, #{type}, #{containerId}, 0,\n+        0, 0) <!-- we specify zero because column is non-null; subsequent update will replace with GUID) -->","path":"service/discussion/src/main/resources/com/wikia/discussionservice/dao/DiscussionThreadDao.xml","position":13,"original_position":13,"commit_id":"1ac90c20c538b5ac34c89cf9bef45c7bb7d755cd","original_commit_id":"1ac90c20c538b5ac34c89cf9bef45c7bb7d755cd","user":{"login":"jimmordino","id":824016,"avatar_url":"https://avatars.githubusercontent.com/u/824016?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmordino","html_url":"https://github.com/jimmordino","followers_url":"https://api.github.com/users/jimmordino/followers","following_url":"https://api.github.com/users/jimmordino/following{/other_user}","gists_url":"https://api.github.com/users/jimmordino/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmordino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmordino/subscriptions","organizations_url":"https://api.github.com/users/jimmordino/orgs","repos_url":"https://api.github.com/users/jimmordino/repos","events_url":"https://api.github.com/users/jimmordino/events{/privacy}","received_events_url":"https://api.github.com/users/jimmordino/received_events","type":"User","site_admin":false},"body":"Trivial: copypasta comment - should state that post IDs are updated after post has been created.","created_at":"2015-05-04T20:14:19Z","updated_at":"2015-05-04T20:14:19Z","html_url":"https://github.com/Wikia/pandora/pull/189#discussion_r29618730","pull_request_url":"https://api.github.com/repos/Wikia/pandora/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments/29618730"},"html":{"href":"https://github.com/Wikia/pandora/pull/189#discussion_r29618730"},"pull_request":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/189","id":34666410,"html_url":"https://github.com/Wikia/pandora/pull/189","diff_url":"https://github.com/Wikia/pandora/pull/189.diff","patch_url":"https://github.com/Wikia/pandora/pull/189.patch","issue_url":"https://api.github.com/repos/Wikia/pandora/issues/189","number":189,"state":"open","locked":false,"title":"First attempt of adding Authz into Discussion Service","user":{"login":"jogura","id":907775,"avatar_url":"https://avatars.githubusercontent.com/u/907775?v=3","gravatar_id":"","url":"https://api.github.com/users/jogura","html_url":"https://github.com/jogura","followers_url":"https://api.github.com/users/jogura/followers","following_url":"https://api.github.com/users/jogura/following{/other_user}","gists_url":"https://api.github.com/users/jogura/gists{/gist_id}","starred_url":"https://api.github.com/users/jogura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jogura/subscriptions","organizations_url":"https://api.github.com/users/jogura/orgs","repos_url":"https://api.github.com/users/jogura/repos","events_url":"https://api.github.com/users/jogura/events{/privacy}","received_events_url":"https://api.github.com/users/jogura/received_events","type":"User","site_admin":false},"body":"This PR attempts to encapsulate Authz into functional interfaces. The idea is to avoid sprinkling logic that checks user's roles all over the code base. Instead, the activity (`SecureActivity`) is used to authorize the current user. This subtle, change will allow for business changes to only occur in place in the code.\r\n\r\nThe PostResource/PostService were also refactored slightly to use the `com.wikia.discussionservice.auth.User` instead of the domain user. @armonr please review those changes.\r\n\r\nUnit tests were added for the Authz code and integration tests were added for ThreadResource.\r\n\r\nRFCR @jimmordino @armonr and anyone else ","created_at":"2015-05-04T19:26:27Z","updated_at":"2015-05-04T20:14:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9147cd80d228e521885ad3c696ee02bd0ece163a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/pandora/pulls/189/commits","review_comments_url":"https://api.github.com/repos/Wikia/pandora/pulls/189/comments","review_comment_url":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/pandora/issues/189/comments","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/1ac90c20c538b5ac34c89cf9bef45c7bb7d755cd","head":{"label":"Wikia:DIS-15-thread-resource-with-authz","ref":"DIS-15-thread-resource-with-authz","sha":"1ac90c20c538b5ac34c89cf9bef45c7bb7d755cd","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-05-04T19:13:14Z","pushed_at":"2015-05-04T19:26:27Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":9615,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"Wikia:DIS-15","ref":"DIS-15","sha":"9f7f80e8c5c8cfbd548d54aaddf88ac4d0c5c69d","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-05-04T19:13:14Z","pushed_at":"2015-05-04T19:26:27Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":9615,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/189"},"html":{"href":"https://github.com/Wikia/pandora/pull/189"},"issue":{"href":"https://api.github.com/repos/Wikia/pandora/issues/189"},"comments":{"href":"https://api.github.com/repos/Wikia/pandora/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/pandora/statuses/1ac90c20c538b5ac34c89cf9bef45c7bb7d755cd"}}}}