{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/comments/135933287","pull_request_review_id":59405394,"id":135933287,"diff_hunk":"@@ -0,0 +1,41 @@\n+import { Injectable } from '@angular/core';\n+import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\n+import { AuthService } from '../auth.service';\n+\n+/**\n+ * A guard used by the router in order to check whether a the user has\n+ * the necessary access rights. If not, the user is redirected to the\n+ * login page and the original request url will be appended to the\n+ * 'returnUrl' query parameter.\n+ */\n+@Injectable()\n+export class AuthGuard implements CanActivate {\n+\n+  constructor(private router: Router, private authService: AuthService) { }\n+\n+  /**\n+   * If true the user has access to the route, if false, the user will\n+   * be redirected to the login url.\n+   *\n+   * @param route\n+   * @param state\n+   */\n+  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n+\n+    const securityInfo = this.authService.securityInfo;\n+    const routeNeedsAuthentication = route.data.authenticate;\n+    const rolesNeeded: string[] = route.data.roles;","path":"ui/src/app/auth/support/auth.guard.ts","position":27,"original_position":27,"commit_id":"630da3484896f6f51040bbff74944b1b27a1fdcd","original_commit_id":"892ce5ecf4d54cf4db19bd9227666fc689627770","user":{"login":"ghillert","id":685363,"avatar_url":"https://avatars0.githubusercontent.com/u/685363?v=4","gravatar_id":"","url":"https://api.github.com/users/ghillert","html_url":"https://github.com/ghillert","followers_url":"https://api.github.com/users/ghillert/followers","following_url":"https://api.github.com/users/ghillert/following{/other_user}","gists_url":"https://api.github.com/users/ghillert/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillert/subscriptions","organizations_url":"https://api.github.com/users/ghillert/orgs","repos_url":"https://api.github.com/users/ghillert/repos","events_url":"https://api.github.com/users/ghillert/events{/privacy}","received_events_url":"https://api.github.com/users/ghillert/received_events","type":"User","site_admin":false},"body":"It is actually.","created_at":"2017-08-29T22:58:23Z","updated_at":"2017-08-29T22:58:23Z","html_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364#discussion_r135933287","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/comments/135933287"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364#discussion_r135933287"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364"}},"in_reply_to_id":134837903},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364","id":136923276,"html_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364","diff_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/364","number":364,"state":"open","locked":false,"title":"gh-297 Port security infrastructure to Angular4 stack","user":{"login":"ghillert","id":685363,"avatar_url":"https://avatars0.githubusercontent.com/u/685363?v=4","gravatar_id":"","url":"https://api.github.com/users/ghillert","html_url":"https://github.com/ghillert","followers_url":"https://api.github.com/users/ghillert/followers","following_url":"https://api.github.com/users/ghillert/following{/other_user}","gists_url":"https://api.github.com/users/ghillert/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillert/subscriptions","organizations_url":"https://api.github.com/users/ghillert/orgs","repos_url":"https://api.github.com/users/ghillert/repos","events_url":"https://api.github.com/users/ghillert/events{/privacy}","received_events_url":"https://api.github.com/users/ghillert/received_events","type":"User","site_admin":false},"body":"- Port the non-oauth-based security to Angular 4\r\n- Add Roles directive\r\n\r\nresolves https://github.com/spring-cloud/spring-cloud-dataflow-ui/issues/297","created_at":"2017-08-22T08:46:44Z","updated_at":"2017-08-29T22:58:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2947357febd44e248fd819186bde60c853bed710","assignee":{"login":"cppwfs","id":695673,"avatar_url":"https://avatars1.githubusercontent.com/u/695673?v=4","gravatar_id":"","url":"https://api.github.com/users/cppwfs","html_url":"https://github.com/cppwfs","followers_url":"https://api.github.com/users/cppwfs/followers","following_url":"https://api.github.com/users/cppwfs/following{/other_user}","gists_url":"https://api.github.com/users/cppwfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cppwfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppwfs/subscriptions","organizations_url":"https://api.github.com/users/cppwfs/orgs","repos_url":"https://api.github.com/users/cppwfs/repos","events_url":"https://api.github.com/users/cppwfs/events{/privacy}","received_events_url":"https://api.github.com/users/cppwfs/received_events","type":"User","site_admin":false},"assignees":[{"login":"cppwfs","id":695673,"avatar_url":"https://avatars1.githubusercontent.com/u/695673?v=4","gravatar_id":"","url":"https://api.github.com/users/cppwfs","html_url":"https://github.com/cppwfs","followers_url":"https://api.github.com/users/cppwfs/followers","following_url":"https://api.github.com/users/cppwfs/following{/other_user}","gists_url":"https://api.github.com/users/cppwfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cppwfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppwfs/subscriptions","organizations_url":"https://api.github.com/users/cppwfs/orgs","repos_url":"https://api.github.com/users/cppwfs/repos","events_url":"https://api.github.com/users/cppwfs/events{/privacy}","received_events_url":"https://api.github.com/users/cppwfs/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/364/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/statuses/630da3484896f6f51040bbff74944b1b27a1fdcd","head":{"label":"ghillert:gh-297","ref":"gh-297","sha":"630da3484896f6f51040bbff74944b1b27a1fdcd","user":{"login":"ghillert","id":685363,"avatar_url":"https://avatars0.githubusercontent.com/u/685363?v=4","gravatar_id":"","url":"https://api.github.com/users/ghillert","html_url":"https://github.com/ghillert","followers_url":"https://api.github.com/users/ghillert/followers","following_url":"https://api.github.com/users/ghillert/following{/other_user}","gists_url":"https://api.github.com/users/ghillert/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillert/subscriptions","organizations_url":"https://api.github.com/users/ghillert/orgs","repos_url":"https://api.github.com/users/ghillert/repos","events_url":"https://api.github.com/users/ghillert/events{/privacy}","received_events_url":"https://api.github.com/users/ghillert/received_events","type":"User","site_admin":false},"repo":{"id":46747477,"name":"spring-cloud-dataflow-ui","full_name":"ghillert/spring-cloud-dataflow-ui","owner":{"login":"ghillert","id":685363,"avatar_url":"https://avatars0.githubusercontent.com/u/685363?v=4","gravatar_id":"","url":"https://api.github.com/users/ghillert","html_url":"https://github.com/ghillert","followers_url":"https://api.github.com/users/ghillert/followers","following_url":"https://api.github.com/users/ghillert/following{/other_user}","gists_url":"https://api.github.com/users/ghillert/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillert/subscriptions","organizations_url":"https://api.github.com/users/ghillert/orgs","repos_url":"https://api.github.com/users/ghillert/repos","events_url":"https://api.github.com/users/ghillert/events{/privacy}","received_events_url":"https://api.github.com/users/ghillert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ghillert/spring-cloud-dataflow-ui","description":null,"fork":true,"url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui","forks_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/forks","keys_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/teams","hooks_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/hooks","issue_events_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/issues/events{/number}","events_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/events","assignees_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/assignees{/user}","branches_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/branches{/branch}","tags_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/tags","blobs_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/languages","stargazers_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/stargazers","contributors_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/contributors","subscribers_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/subscribers","subscription_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/subscription","commits_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/contents/{+path}","compare_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/merges","archive_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/downloads","issues_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/issues{/number}","pulls_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/labels{/name}","releases_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/releases{/id}","deployments_url":"https://api.github.com/repos/ghillert/spring-cloud-dataflow-ui/deployments","created_at":"2015-11-23T20:56:02Z","updated_at":"2017-07-31T21:04:40Z","pushed_at":"2017-08-29T22:56:52Z","git_url":"git://github.com/ghillert/spring-cloud-dataflow-ui.git","ssh_url":"git@github.com:ghillert/spring-cloud-dataflow-ui.git","clone_url":"https://github.com/ghillert/spring-cloud-dataflow-ui.git","svn_url":"https://github.com/ghillert/spring-cloud-dataflow-ui","homepage":null,"size":4936,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":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":"spring-cloud:master","ref":"master","sha":"0088e21119b034c6f0e6e65159a7ef7833cbaae9","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars0.githubusercontent.com/u/7815877?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":45694880,"name":"spring-cloud-dataflow-ui","full_name":"spring-cloud/spring-cloud-dataflow-ui","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars0.githubusercontent.com/u/7815877?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui","description":"This repo provides the Dashboard application of Spring Cloud Data Flow","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/deployments","created_at":"2015-11-06T16:57:06Z","updated_at":"2017-08-25T12:13:12Z","pushed_at":"2017-08-29T22:56:53Z","git_url":"git://github.com/spring-cloud/spring-cloud-dataflow-ui.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-dataflow-ui.git","clone_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui.git","svn_url":"https://github.com/spring-cloud/spring-cloud-dataflow-ui","homepage":"http://cloud.spring.io/spring-cloud-dataflow/","size":6339,"stargazers_count":23,"watchers_count":23,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"open_issues_count":57,"forks":30,"open_issues":57,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-dataflow-ui/pull/364"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/364"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/pulls/364/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-dataflow-ui/statuses/630da3484896f6f51040bbff74944b1b27a1fdcd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ghillert"}}