{"action":"created","issue":{"url":"https://api.github.com/repos/Wikia/pandora/issues/617","labels_url":"https://api.github.com/repos/Wikia/pandora/issues/617/labels{/name}","comments_url":"https://api.github.com/repos/Wikia/pandora/issues/617/comments","events_url":"https://api.github.com/repos/Wikia/pandora/issues/617/events","html_url":"https://github.com/Wikia/pandora/pull/617","id":116211602,"number":617,"title":"MOB-5963 Implement service side permissions, integrates with the user permission 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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-10T21:58:13Z","updated_at":"2015-11-10T21:58:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/617","html_url":"https://github.com/Wikia/pandora/pull/617","diff_url":"https://github.com/Wikia/pandora/pull/617.diff","patch_url":"https://github.com/Wikia/pandora/pull/617.patch"},"body":"Unfortunately, at the ServiceRealm layer the only way to know the context of the request (what wiki the request is for) is to parse the `siteId`. Which is why the request URL is required.\r\n\r\n* This approaches uses hand rolled HTTP client to integrate with the user permissions service, because of issues with the swagger client\r\n* Add functionality in the AggregateService class to decorate outbound Posts with user specific permissions if applicable\r\n* Each post is decorated with user specific \"permissions\" on what actions the client could take for this given user. As we extend capabilities the list of \"permissions\" will change.\r\n* The ServiceRealm abstract was modified to limit the dependencies to other services to the actual service tier and not the lib tier\r\n* Minor swagger changes to match the appropriate response for \"upvoting\" and \"undo upvoting\"\r\n* Added unit tests to test permissions\r\n\r\nRFCR @garthwebb @armonr @jsutterfield @jimmordino "},"comment":{"url":"https://api.github.com/repos/Wikia/pandora/issues/comments/155581026","html_url":"https://github.com/Wikia/pandora/pull/617#issuecomment-155581026","issue_url":"https://api.github.com/repos/Wikia/pandora/issues/617","id":155581026,"user":{"login":"WikiaTech","id":13279985,"avatar_url":"https://avatars.githubusercontent.com/u/13279985?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiaTech","html_url":"https://github.com/WikiaTech","followers_url":"https://api.github.com/users/WikiaTech/followers","following_url":"https://api.github.com/users/WikiaTech/following{/other_user}","gists_url":"https://api.github.com/users/WikiaTech/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiaTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiaTech/subscriptions","organizations_url":"https://api.github.com/users/WikiaTech/orgs","repos_url":"https://api.github.com/users/WikiaTech/repos","events_url":"https://api.github.com/users/WikiaTech/events{/privacy}","received_events_url":"https://api.github.com/users/WikiaTech/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T21:58:54Z","updated_at":"2015-11-10T21:58:54Z","body":"SonarQube analysis reported 15 issues:\n* ![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) 6 major\n* ![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) 9 minor\n\nWatch the comments in this conversation to review them.\nNote: the following issues could not be reported as comments because they are located on lines that are not displayed in this pull request:\n* ![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) [Move this trailing comment on the previous empty line.](https://github.com/Wikia/pandora/blob/ee6c825f2ca313e8c0136c200cdbeaf104c2f28e/lib/service-core/src/main/java/com/wikia/pandora/core/auth/ServiceAuthenticatingFilter.java#L57) [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3ATrailingCommentCheck)\n* ![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) [Define and throw a dedicated exception instead of using a generic one.](https://github.com/Wikia/pandora/blob/ee6c825f2ca313e8c0136c200cdbeaf104c2f28e/service/discussion/src/main/java/com/wikia/discussionservice/auth/SecureActivity.java#L31) [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AS00112)\n* ![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) [Remove this unused import 'com.wikia.discussionservice.domain.hal.output.PostHalResponse'.](https://github.com/Wikia/pandora/blob/ee6c825f2ca313e8c0136c200cdbeaf104c2f28e/service/discussion/src/main/java/com/wikia/discussionservice/resources/VoteResource.java#L5) [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AUselessImportCheck)\n* ![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) [Define a constant instead of duplicating this literal \"/%s/posts/%s\" 3 times.](https://github.com/Wikia/pandora/blob/ee6c825f2ca313e8c0136c200cdbeaf104c2f28e/service/discussion/src/test/java/com/wikia/discussionservice/resources/PostResourceTest.java#L111) [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AS1192)\n* ![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) [2 duplicated blocks of code must be removed.](https://github.com/Wikia/pandora/blob/ee6c825f2ca313e8c0136c200cdbeaf104c2f28e/service/discussion/src/test/java/com/wikia/discussionservice/resources/PostResourceTest.java) [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=common-java%3ADuplicatedBlocks)\n"}}