{"action":"created","comment":{"url":"https://api.github.com/repos/gamantha/ats-core/pulls/comments/192335876","pull_request_review_id":125090692,"id":192335876,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjMzNTg3Ng==","diff_hunk":"@@ -17,25 +21,36 @@ public function __construct()\n     {\n         $this->middleware('auth');\n \n-        $this->middleware('role:org:admin|org:recruiter')->only('index');\n+        $this->middleware('role:org:admin|org:recruiter')->only('index', 'show', 'edit');\n \n-        $this->middleware('role:org:admin')->except('index');\n+        $this->middleware('role:org:admin')->except('index', 'show', 'edit');\n     }\n \n     public function index()\n     {\n-        $orgs = Organization::orderBy('id')->paginate(5);\n+        $id = Auth::user()->id;\n+        $roleorg = OrganizationRoles::where('user_id', $id)->value('role_name');\n \n-        return view('organizations.index', compact('orgs'));\n+        if ($roleorg == 'admin' || $roleorg == 'recruiter') {\n+            $orgs = User::join('organization_roles', 'users.id', '=', 'organization_roles.id')\n+                ->join('organizations', 'organization_roles.organization_id', '=', 'organizations.id')\n+                ->where('users.id', '=', $id)\n+                ->paginate(5);\n+\n+            return view('organizations.index', compact('orgs', 'roleorg'));\n+        } else {","path":"app/Http/Controllers/OrganizationsController.php","position":38,"original_position":38,"commit_id":"2b2f23344909c28b063c29bf90e133abfeb7bf8d","original_commit_id":"2b2f23344909c28b063c29bf90e133abfeb7bf8d","user":{"login":"afrastgeek","id":4904057,"node_id":"MDQ6VXNlcjQ5MDQwNTc=","avatar_url":"https://avatars2.githubusercontent.com/u/4904057?v=4","gravatar_id":"","url":"https://api.github.com/users/afrastgeek","html_url":"https://github.com/afrastgeek","followers_url":"https://api.github.com/users/afrastgeek/followers","following_url":"https://api.github.com/users/afrastgeek/following{/other_user}","gists_url":"https://api.github.com/users/afrastgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/afrastgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afrastgeek/subscriptions","organizations_url":"https://api.github.com/users/afrastgeek/orgs","repos_url":"https://api.github.com/users/afrastgeek/repos","events_url":"https://api.github.com/users/afrastgeek/events{/privacy}","received_events_url":"https://api.github.com/users/afrastgeek/received_events","type":"User","site_admin":false},"body":"statement di dalam `else` ini tidak akan pernah terjangkau, karena middleware hanya membatasi akses kepada user dengan role `org:admin` dan `org:recruiter`.\r\n\r\nLebih baik kondisi if else ini dihapus saja, gunakan kode di dalam blok `if`.","created_at":"2018-06-01T08:57:03Z","updated_at":"2018-06-01T08:59:28Z","html_url":"https://github.com/gamantha/ats-core/pull/78#discussion_r192335876","pull_request_url":"https://api.github.com/repos/gamantha/ats-core/pulls/78","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/comments/192335876"},"html":{"href":"https://github.com/gamantha/ats-core/pull/78#discussion_r192335876"},"pull_request":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/gamantha/ats-core/pulls/78","id":191943241,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxOTQzMjQx","html_url":"https://github.com/gamantha/ats-core/pull/78","diff_url":"https://github.com/gamantha/ats-core/pull/78.diff","patch_url":"https://github.com/gamantha/ats-core/pull/78.patch","issue_url":"https://api.github.com/repos/gamantha/ats-core/issues/78","number":78,"state":"open","locked":false,"title":"Organization CRUD limitation for org:admin #74","user":{"login":"YudhaWork033","id":38399980,"node_id":"MDQ6VXNlcjM4Mzk5OTgw","avatar_url":"https://avatars0.githubusercontent.com/u/38399980?v=4","gravatar_id":"","url":"https://api.github.com/users/YudhaWork033","html_url":"https://github.com/YudhaWork033","followers_url":"https://api.github.com/users/YudhaWork033/followers","following_url":"https://api.github.com/users/YudhaWork033/following{/other_user}","gists_url":"https://api.github.com/users/YudhaWork033/gists{/gist_id}","starred_url":"https://api.github.com/users/YudhaWork033/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YudhaWork033/subscriptions","organizations_url":"https://api.github.com/users/YudhaWork033/orgs","repos_url":"https://api.github.com/users/YudhaWork033/repos","events_url":"https://api.github.com/users/YudhaWork033/events{/privacy}","received_events_url":"https://api.github.com/users/YudhaWork033/received_events","type":"User","site_admin":false},"body":"Organization CRUD limitation for org:admin #74","created_at":"2018-06-01T06:16:36Z","updated_at":"2018-06-01T08:59:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"265b8b65da423c06058eb18f90af4db069f194b1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gamantha/ats-core/pulls/78/commits","review_comments_url":"https://api.github.com/repos/gamantha/ats-core/pulls/78/comments","review_comment_url":"https://api.github.com/repos/gamantha/ats-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gamantha/ats-core/issues/78/comments","statuses_url":"https://api.github.com/repos/gamantha/ats-core/statuses/2b2f23344909c28b063c29bf90e133abfeb7bf8d","head":{"label":"gamantha:p-ats-core","ref":"p-ats-core","sha":"2b2f23344909c28b063c29bf90e133abfeb7bf8d","user":{"login":"gamantha","id":13807330,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODA3MzMw","avatar_url":"https://avatars0.githubusercontent.com/u/13807330?v=4","gravatar_id":"","url":"https://api.github.com/users/gamantha","html_url":"https://github.com/gamantha","followers_url":"https://api.github.com/users/gamantha/followers","following_url":"https://api.github.com/users/gamantha/following{/other_user}","gists_url":"https://api.github.com/users/gamantha/gists{/gist_id}","starred_url":"https://api.github.com/users/gamantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamantha/subscriptions","organizations_url":"https://api.github.com/users/gamantha/orgs","repos_url":"https://api.github.com/users/gamantha/repos","events_url":"https://api.github.com/users/gamantha/events{/privacy}","received_events_url":"https://api.github.com/users/gamantha/received_events","type":"Organization","site_admin":false},"repo":{"id":131079212,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEwNzkyMTI=","name":"ats-core","full_name":"gamantha/ats-core","owner":{"login":"gamantha","id":13807330,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODA3MzMw","avatar_url":"https://avatars0.githubusercontent.com/u/13807330?v=4","gravatar_id":"","url":"https://api.github.com/users/gamantha","html_url":"https://github.com/gamantha","followers_url":"https://api.github.com/users/gamantha/followers","following_url":"https://api.github.com/users/gamantha/following{/other_user}","gists_url":"https://api.github.com/users/gamantha/gists{/gist_id}","starred_url":"https://api.github.com/users/gamantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamantha/subscriptions","organizations_url":"https://api.github.com/users/gamantha/orgs","repos_url":"https://api.github.com/users/gamantha/repos","events_url":"https://api.github.com/users/gamantha/events{/privacy}","received_events_url":"https://api.github.com/users/gamantha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gamantha/ats-core","description":"candidate application tracking system","fork":false,"url":"https://api.github.com/repos/gamantha/ats-core","forks_url":"https://api.github.com/repos/gamantha/ats-core/forks","keys_url":"https://api.github.com/repos/gamantha/ats-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gamantha/ats-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gamantha/ats-core/teams","hooks_url":"https://api.github.com/repos/gamantha/ats-core/hooks","issue_events_url":"https://api.github.com/repos/gamantha/ats-core/issues/events{/number}","events_url":"https://api.github.com/repos/gamantha/ats-core/events","assignees_url":"https://api.github.com/repos/gamantha/ats-core/assignees{/user}","branches_url":"https://api.github.com/repos/gamantha/ats-core/branches{/branch}","tags_url":"https://api.github.com/repos/gamantha/ats-core/tags","blobs_url":"https://api.github.com/repos/gamantha/ats-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gamantha/ats-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gamantha/ats-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/gamantha/ats-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gamantha/ats-core/statuses/{sha}","languages_url":"https://api.github.com/repos/gamantha/ats-core/languages","stargazers_url":"https://api.github.com/repos/gamantha/ats-core/stargazers","contributors_url":"https://api.github.com/repos/gamantha/ats-core/contributors","subscribers_url":"https://api.github.com/repos/gamantha/ats-core/subscribers","subscription_url":"https://api.github.com/repos/gamantha/ats-core/subscription","commits_url":"https://api.github.com/repos/gamantha/ats-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/gamantha/ats-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/gamantha/ats-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/gamantha/ats-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/gamantha/ats-core/contents/{+path}","compare_url":"https://api.github.com/repos/gamantha/ats-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gamantha/ats-core/merges","archive_url":"https://api.github.com/repos/gamantha/ats-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gamantha/ats-core/downloads","issues_url":"https://api.github.com/repos/gamantha/ats-core/issues{/number}","pulls_url":"https://api.github.com/repos/gamantha/ats-core/pulls{/number}","milestones_url":"https://api.github.com/repos/gamantha/ats-core/milestones{/number}","notifications_url":"https://api.github.com/repos/gamantha/ats-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gamantha/ats-core/labels{/name}","releases_url":"https://api.github.com/repos/gamantha/ats-core/releases{/id}","deployments_url":"https://api.github.com/repos/gamantha/ats-core/deployments","created_at":"2018-04-26T00:38:54Z","updated_at":"2018-05-18T03:09:50Z","pushed_at":"2018-06-01T08:46:49Z","git_url":"git://github.com/gamantha/ats-core.git","ssh_url":"git@github.com:gamantha/ats-core.git","clone_url":"https://github.com/gamantha/ats-core.git","svn_url":"https://github.com/gamantha/ats-core","homepage":null,"size":808,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":0,"open_issues":12,"watchers":0,"default_branch":"master"}},"base":{"label":"gamantha:dev","ref":"dev","sha":"de5eff64605379bec12e33ff7d0de5072a0bd88e","user":{"login":"gamantha","id":13807330,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODA3MzMw","avatar_url":"https://avatars0.githubusercontent.com/u/13807330?v=4","gravatar_id":"","url":"https://api.github.com/users/gamantha","html_url":"https://github.com/gamantha","followers_url":"https://api.github.com/users/gamantha/followers","following_url":"https://api.github.com/users/gamantha/following{/other_user}","gists_url":"https://api.github.com/users/gamantha/gists{/gist_id}","starred_url":"https://api.github.com/users/gamantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamantha/subscriptions","organizations_url":"https://api.github.com/users/gamantha/orgs","repos_url":"https://api.github.com/users/gamantha/repos","events_url":"https://api.github.com/users/gamantha/events{/privacy}","received_events_url":"https://api.github.com/users/gamantha/received_events","type":"Organization","site_admin":false},"repo":{"id":131079212,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEwNzkyMTI=","name":"ats-core","full_name":"gamantha/ats-core","owner":{"login":"gamantha","id":13807330,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODA3MzMw","avatar_url":"https://avatars0.githubusercontent.com/u/13807330?v=4","gravatar_id":"","url":"https://api.github.com/users/gamantha","html_url":"https://github.com/gamantha","followers_url":"https://api.github.com/users/gamantha/followers","following_url":"https://api.github.com/users/gamantha/following{/other_user}","gists_url":"https://api.github.com/users/gamantha/gists{/gist_id}","starred_url":"https://api.github.com/users/gamantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamantha/subscriptions","organizations_url":"https://api.github.com/users/gamantha/orgs","repos_url":"https://api.github.com/users/gamantha/repos","events_url":"https://api.github.com/users/gamantha/events{/privacy}","received_events_url":"https://api.github.com/users/gamantha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gamantha/ats-core","description":"candidate application tracking system","fork":false,"url":"https://api.github.com/repos/gamantha/ats-core","forks_url":"https://api.github.com/repos/gamantha/ats-core/forks","keys_url":"https://api.github.com/repos/gamantha/ats-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gamantha/ats-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gamantha/ats-core/teams","hooks_url":"https://api.github.com/repos/gamantha/ats-core/hooks","issue_events_url":"https://api.github.com/repos/gamantha/ats-core/issues/events{/number}","events_url":"https://api.github.com/repos/gamantha/ats-core/events","assignees_url":"https://api.github.com/repos/gamantha/ats-core/assignees{/user}","branches_url":"https://api.github.com/repos/gamantha/ats-core/branches{/branch}","tags_url":"https://api.github.com/repos/gamantha/ats-core/tags","blobs_url":"https://api.github.com/repos/gamantha/ats-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gamantha/ats-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gamantha/ats-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/gamantha/ats-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gamantha/ats-core/statuses/{sha}","languages_url":"https://api.github.com/repos/gamantha/ats-core/languages","stargazers_url":"https://api.github.com/repos/gamantha/ats-core/stargazers","contributors_url":"https://api.github.com/repos/gamantha/ats-core/contributors","subscribers_url":"https://api.github.com/repos/gamantha/ats-core/subscribers","subscription_url":"https://api.github.com/repos/gamantha/ats-core/subscription","commits_url":"https://api.github.com/repos/gamantha/ats-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/gamantha/ats-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/gamantha/ats-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/gamantha/ats-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/gamantha/ats-core/contents/{+path}","compare_url":"https://api.github.com/repos/gamantha/ats-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gamantha/ats-core/merges","archive_url":"https://api.github.com/repos/gamantha/ats-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gamantha/ats-core/downloads","issues_url":"https://api.github.com/repos/gamantha/ats-core/issues{/number}","pulls_url":"https://api.github.com/repos/gamantha/ats-core/pulls{/number}","milestones_url":"https://api.github.com/repos/gamantha/ats-core/milestones{/number}","notifications_url":"https://api.github.com/repos/gamantha/ats-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gamantha/ats-core/labels{/name}","releases_url":"https://api.github.com/repos/gamantha/ats-core/releases{/id}","deployments_url":"https://api.github.com/repos/gamantha/ats-core/deployments","created_at":"2018-04-26T00:38:54Z","updated_at":"2018-05-18T03:09:50Z","pushed_at":"2018-06-01T08:46:49Z","git_url":"git://github.com/gamantha/ats-core.git","ssh_url":"git@github.com:gamantha/ats-core.git","clone_url":"https://github.com/gamantha/ats-core.git","svn_url":"https://github.com/gamantha/ats-core","homepage":null,"size":808,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":0,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/78"},"html":{"href":"https://github.com/gamantha/ats-core/pull/78"},"issue":{"href":"https://api.github.com/repos/gamantha/ats-core/issues/78"},"comments":{"href":"https://api.github.com/repos/gamantha/ats-core/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gamantha/ats-core/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/gamantha/ats-core/statuses/2b2f23344909c28b063c29bf90e133abfeb7bf8d"}},"author_association":"NONE"}}
{"actor":{"display_login":"afrastgeek"}}