{"action":"created","comment":{"url":"https://api.github.com/repos/foam-framework/foam2/pulls/comments/243563509","pull_request_review_id":187369067,"id":243563509,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzU2MzUwOQ==","diff_hunk":"@@ -0,0 +1,95 @@\n+foam.CLASS({\n+  package: 'foam.nanos.auth',\n+  name: 'LogoutDisabledUserDAO',\n+  extends: 'foam.dao.ProxyDAO',\n+\n+  documentation: `DAO decorator that forcefully logout user who is being disabled.`,\n+\n+  javaImports: [\n+    'foam.dao.ArraySink',\n+    'foam.dao.DAO',\n+    'foam.mlang.MLang',\n+    'foam.nanos.auth.AuthService',\n+    'foam.nanos.auth.User',\n+    'foam.nanos.session.Session',\n+    'foam.util.SafetyUtil',\n+    'net.nanopay.model.Business',\n+    'java.util.List'\n+  ],\n+\n+  methods: [\n+    {\n+      name: 'put_',\n+      javaCode: `\n+        User newUser = (User) obj;\n+        User oldUser = (User) getDelegate().find(newUser.getId());\n+\n+        if (\n+          oldUser != null\n+          && oldUser.getEnabled()\n+          && !newUser.getEnabled()\n+        ) {\n+          sessionDAO_ = (DAO) x.get(\"sessionDAO\");\n+          auth_ = (AuthService) x.get(\"auth\");\n+\n+          logoutUser(newUser, null);\n+          logoutAgent(newUser, newUser.getEntities(x).getDAO());\n+        }\n+\n+        return super.put_(x, obj);\n+      `\n+    },\n+    {\n+      name: 'logoutAgent',\n+      javaReturns: 'void',\n+      args: [\n+        { of: 'User', name: 'user' },\n+        { of: 'DAO', name: 'entitiesDAO'}\n+      ],\n+      javaCode: `\n+        ArraySink sink = (ArraySink) entitiesDAO.select(new ArraySink());\n+        List<Business> businesses = sink.getArray();\n+","path":"src/foam/nanos/auth/LogoutDisabledUserDAO.js","position":48,"original_position":52,"commit_id":"fa3d127db12bc961bb42434abfd6cdb861ba10f5","original_commit_id":"788546df1802b0ada23ec9af6d28c13c26ae0bef","user":{"login":"lchanmann","id":441658,"node_id":"MDQ6VXNlcjQ0MTY1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/441658?v=4","gravatar_id":"","url":"https://api.github.com/users/lchanmann","html_url":"https://github.com/lchanmann","followers_url":"https://api.github.com/users/lchanmann/followers","following_url":"https://api.github.com/users/lchanmann/following{/other_user}","gists_url":"https://api.github.com/users/lchanmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lchanmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchanmann/subscriptions","organizations_url":"https://api.github.com/users/lchanmann/orgs","repos_url":"https://api.github.com/users/lchanmann/repos","events_url":"https://api.github.com/users/lchanmann/events{/privacy}","received_events_url":"https://api.github.com/users/lchanmann/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2018-12-21T11:59:13Z","updated_at":"2018-12-21T11:59:14Z","html_url":"https://github.com/foam-framework/foam2/pull/1760#discussion_r243563509","pull_request_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1760","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/comments/243563509"},"html":{"href":"https://github.com/foam-framework/foam2/pull/1760#discussion_r243563509"},"pull_request":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1760"}},"in_reply_to_id":243450013},"pull_request":{"url":"https://api.github.com/repos/foam-framework/foam2/pulls/1760","id":240321323,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMzIxMzIz","html_url":"https://github.com/foam-framework/foam2/pull/1760","diff_url":"https://github.com/foam-framework/foam2/pull/1760.diff","patch_url":"https://github.com/foam-framework/foam2/pull/1760.patch","issue_url":"https://api.github.com/repos/foam-framework/foam2/issues/1760","number":1760,"state":"open","locked":false,"title":"Logout user/agent when being disabled","user":{"login":"lchanmann","id":441658,"node_id":"MDQ6VXNlcjQ0MTY1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/441658?v=4","gravatar_id":"","url":"https://api.github.com/users/lchanmann","html_url":"https://github.com/lchanmann","followers_url":"https://api.github.com/users/lchanmann/followers","following_url":"https://api.github.com/users/lchanmann/following{/other_user}","gists_url":"https://api.github.com/users/lchanmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lchanmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchanmann/subscriptions","organizations_url":"https://api.github.com/users/lchanmann/orgs","repos_url":"https://api.github.com/users/lchanmann/repos","events_url":"https://api.github.com/users/lchanmann/events{/privacy}","received_events_url":"https://api.github.com/users/lchanmann/received_events","type":"User","site_admin":false},"body":"Forcefully logout user when being disabled:\r\n\r\n- [x] Logout the user session\r\n- [x] Logout all agents who currently login and act as the user\r\n\r\nExtracted from: https://github.com/nanoPayinc/NANOPAY/pull/5354","created_at":"2018-12-20T22:33:56Z","updated_at":"2018-12-21T11:59:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8212a769cf834b836d1f0a5461a1343f073dbbe5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1019586488,"node_id":"MDU6TGFiZWwxMDE5NTg2NDg4","url":"https://api.github.com/repos/foam-framework/foam2/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1760/commits","review_comments_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1760/comments","review_comment_url":"https://api.github.com/repos/foam-framework/foam2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foam-framework/foam2/issues/1760/comments","statuses_url":"https://api.github.com/repos/foam-framework/foam2/statuses/fa3d127db12bc961bb42434abfd6cdb861ba10f5","head":{"label":"lchanmann:LogoutDisabledUserDAO","ref":"LogoutDisabledUserDAO","sha":"fa3d127db12bc961bb42434abfd6cdb861ba10f5","user":{"login":"lchanmann","id":441658,"node_id":"MDQ6VXNlcjQ0MTY1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/441658?v=4","gravatar_id":"","url":"https://api.github.com/users/lchanmann","html_url":"https://github.com/lchanmann","followers_url":"https://api.github.com/users/lchanmann/followers","following_url":"https://api.github.com/users/lchanmann/following{/other_user}","gists_url":"https://api.github.com/users/lchanmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lchanmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchanmann/subscriptions","organizations_url":"https://api.github.com/users/lchanmann/orgs","repos_url":"https://api.github.com/users/lchanmann/repos","events_url":"https://api.github.com/users/lchanmann/events{/privacy}","received_events_url":"https://api.github.com/users/lchanmann/received_events","type":"User","site_admin":false},"repo":{"id":157418493,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc0MTg0OTM=","name":"foam2","full_name":"lchanmann/foam2","private":false,"owner":{"login":"lchanmann","id":441658,"node_id":"MDQ6VXNlcjQ0MTY1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/441658?v=4","gravatar_id":"","url":"https://api.github.com/users/lchanmann","html_url":"https://github.com/lchanmann","followers_url":"https://api.github.com/users/lchanmann/followers","following_url":"https://api.github.com/users/lchanmann/following{/other_user}","gists_url":"https://api.github.com/users/lchanmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lchanmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchanmann/subscriptions","organizations_url":"https://api.github.com/users/lchanmann/orgs","repos_url":"https://api.github.com/users/lchanmann/repos","events_url":"https://api.github.com/users/lchanmann/events{/privacy}","received_events_url":"https://api.github.com/users/lchanmann/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lchanmann/foam2","description":"FOAM: Feature-Oriented Active Modeller, Version 2","fork":true,"url":"https://api.github.com/repos/lchanmann/foam2","forks_url":"https://api.github.com/repos/lchanmann/foam2/forks","keys_url":"https://api.github.com/repos/lchanmann/foam2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lchanmann/foam2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lchanmann/foam2/teams","hooks_url":"https://api.github.com/repos/lchanmann/foam2/hooks","issue_events_url":"https://api.github.com/repos/lchanmann/foam2/issues/events{/number}","events_url":"https://api.github.com/repos/lchanmann/foam2/events","assignees_url":"https://api.github.com/repos/lchanmann/foam2/assignees{/user}","branches_url":"https://api.github.com/repos/lchanmann/foam2/branches{/branch}","tags_url":"https://api.github.com/repos/lchanmann/foam2/tags","blobs_url":"https://api.github.com/repos/lchanmann/foam2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lchanmann/foam2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lchanmann/foam2/git/refs{/sha}","trees_url":"https://api.github.com/repos/lchanmann/foam2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lchanmann/foam2/statuses/{sha}","languages_url":"https://api.github.com/repos/lchanmann/foam2/languages","stargazers_url":"https://api.github.com/repos/lchanmann/foam2/stargazers","contributors_url":"https://api.github.com/repos/lchanmann/foam2/contributors","subscribers_url":"https://api.github.com/repos/lchanmann/foam2/subscribers","subscription_url":"https://api.github.com/repos/lchanmann/foam2/subscription","commits_url":"https://api.github.com/repos/lchanmann/foam2/commits{/sha}","git_commits_url":"https://api.github.com/repos/lchanmann/foam2/git/commits{/sha}","comments_url":"https://api.github.com/repos/lchanmann/foam2/comments{/number}","issue_comment_url":"https://api.github.com/repos/lchanmann/foam2/issues/comments{/number}","contents_url":"https://api.github.com/repos/lchanmann/foam2/contents/{+path}","compare_url":"https://api.github.com/repos/lchanmann/foam2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lchanmann/foam2/merges","archive_url":"https://api.github.com/repos/lchanmann/foam2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lchanmann/foam2/downloads","issues_url":"https://api.github.com/repos/lchanmann/foam2/issues{/number}","pulls_url":"https://api.github.com/repos/lchanmann/foam2/pulls{/number}","milestones_url":"https://api.github.com/repos/lchanmann/foam2/milestones{/number}","notifications_url":"https://api.github.com/repos/lchanmann/foam2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lchanmann/foam2/labels{/name}","releases_url":"https://api.github.com/repos/lchanmann/foam2/releases{/id}","deployments_url":"https://api.github.com/repos/lchanmann/foam2/deployments","created_at":"2018-11-13T17:19:52Z","updated_at":"2018-12-20T22:19:26Z","pushed_at":"2018-12-21T11:58:36Z","git_url":"git://github.com/lchanmann/foam2.git","ssh_url":"git@github.com:lchanmann/foam2.git","clone_url":"https://github.com/lchanmann/foam2.git","svn_url":"https://github.com/lchanmann/foam2","homepage":"","size":24680,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"foam-framework:master","ref":"master","sha":"0bc671155fa3700eb27d9f4bb88f0af967f3654e","user":{"login":"foam-framework","id":7460756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NjA3NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7460756?v=4","gravatar_id":"","url":"https://api.github.com/users/foam-framework","html_url":"https://github.com/foam-framework","followers_url":"https://api.github.com/users/foam-framework/followers","following_url":"https://api.github.com/users/foam-framework/following{/other_user}","gists_url":"https://api.github.com/users/foam-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/foam-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foam-framework/subscriptions","organizations_url":"https://api.github.com/users/foam-framework/orgs","repos_url":"https://api.github.com/users/foam-framework/repos","events_url":"https://api.github.com/users/foam-framework/events{/privacy}","received_events_url":"https://api.github.com/users/foam-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":50441060,"node_id":"MDEwOlJlcG9zaXRvcnk1MDQ0MTA2MA==","name":"foam2","full_name":"foam-framework/foam2","private":false,"owner":{"login":"foam-framework","id":7460756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NjA3NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7460756?v=4","gravatar_id":"","url":"https://api.github.com/users/foam-framework","html_url":"https://github.com/foam-framework","followers_url":"https://api.github.com/users/foam-framework/followers","following_url":"https://api.github.com/users/foam-framework/following{/other_user}","gists_url":"https://api.github.com/users/foam-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/foam-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foam-framework/subscriptions","organizations_url":"https://api.github.com/users/foam-framework/orgs","repos_url":"https://api.github.com/users/foam-framework/repos","events_url":"https://api.github.com/users/foam-framework/events{/privacy}","received_events_url":"https://api.github.com/users/foam-framework/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/foam-framework/foam2","description":"FOAM: Feature-Oriented Active Modeller, Version 2","fork":false,"url":"https://api.github.com/repos/foam-framework/foam2","forks_url":"https://api.github.com/repos/foam-framework/foam2/forks","keys_url":"https://api.github.com/repos/foam-framework/foam2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foam-framework/foam2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foam-framework/foam2/teams","hooks_url":"https://api.github.com/repos/foam-framework/foam2/hooks","issue_events_url":"https://api.github.com/repos/foam-framework/foam2/issues/events{/number}","events_url":"https://api.github.com/repos/foam-framework/foam2/events","assignees_url":"https://api.github.com/repos/foam-framework/foam2/assignees{/user}","branches_url":"https://api.github.com/repos/foam-framework/foam2/branches{/branch}","tags_url":"https://api.github.com/repos/foam-framework/foam2/tags","blobs_url":"https://api.github.com/repos/foam-framework/foam2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foam-framework/foam2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foam-framework/foam2/git/refs{/sha}","trees_url":"https://api.github.com/repos/foam-framework/foam2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foam-framework/foam2/statuses/{sha}","languages_url":"https://api.github.com/repos/foam-framework/foam2/languages","stargazers_url":"https://api.github.com/repos/foam-framework/foam2/stargazers","contributors_url":"https://api.github.com/repos/foam-framework/foam2/contributors","subscribers_url":"https://api.github.com/repos/foam-framework/foam2/subscribers","subscription_url":"https://api.github.com/repos/foam-framework/foam2/subscription","commits_url":"https://api.github.com/repos/foam-framework/foam2/commits{/sha}","git_commits_url":"https://api.github.com/repos/foam-framework/foam2/git/commits{/sha}","comments_url":"https://api.github.com/repos/foam-framework/foam2/comments{/number}","issue_comment_url":"https://api.github.com/repos/foam-framework/foam2/issues/comments{/number}","contents_url":"https://api.github.com/repos/foam-framework/foam2/contents/{+path}","compare_url":"https://api.github.com/repos/foam-framework/foam2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foam-framework/foam2/merges","archive_url":"https://api.github.com/repos/foam-framework/foam2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foam-framework/foam2/downloads","issues_url":"https://api.github.com/repos/foam-framework/foam2/issues{/number}","pulls_url":"https://api.github.com/repos/foam-framework/foam2/pulls{/number}","milestones_url":"https://api.github.com/repos/foam-framework/foam2/milestones{/number}","notifications_url":"https://api.github.com/repos/foam-framework/foam2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foam-framework/foam2/labels{/name}","releases_url":"https://api.github.com/repos/foam-framework/foam2/releases{/id}","deployments_url":"https://api.github.com/repos/foam-framework/foam2/deployments","created_at":"2016-01-26T16:13:38Z","updated_at":"2018-12-20T21:33:34Z","pushed_at":"2018-12-21T11:58:38Z","git_url":"git://github.com/foam-framework/foam2.git","ssh_url":"git@github.com:foam-framework/foam2.git","clone_url":"https://github.com/foam-framework/foam2.git","svn_url":"https://github.com/foam-framework/foam2","homepage":"","size":24997,"stargazers_count":36,"watchers_count":36,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":174,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":50,"open_issues":174,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1760"},"html":{"href":"https://github.com/foam-framework/foam2/pull/1760"},"issue":{"href":"https://api.github.com/repos/foam-framework/foam2/issues/1760"},"comments":{"href":"https://api.github.com/repos/foam-framework/foam2/issues/1760/comments"},"review_comments":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1760/comments"},"review_comment":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1760/commits"},"statuses":{"href":"https://api.github.com/repos/foam-framework/foam2/statuses/fa3d127db12bc961bb42434abfd6cdb861ba10f5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lchanmann"}}