{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/hotel-management/pulls/comments/206461268","pull_request_review_id":141875882,"id":206461268,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjQ2MTI2OA==","diff_hunk":"@@ -26,7 +26,17 @@ def not_logged_in\n     end\n   end\n \n-  def vetify_admin\n-    redirect_to root_path unless current_user&.admin?\n+  def verify_staff\n+    unless current_user&.staff? || current_user&.admin?\n+      flash[:warning] = t \"users.invalid_action\"\n+      redirect_to root_path\n+    end","path":"app/controllers/application_controller.rb","position":10,"original_position":10,"commit_id":"c673907880b23987fde59110ce3f2280c102f102","original_commit_id":"c673907880b23987fde59110ce3f2280c102f102","user":{"login":"mdmahmudurrahman","id":16096144,"node_id":"MDQ6VXNlcjE2MDk2MTQ0","avatar_url":"https://avatars2.githubusercontent.com/u/16096144?v=4","gravatar_id":"","url":"https://api.github.com/users/mdmahmudurrahman","html_url":"https://github.com/mdmahmudurrahman","followers_url":"https://api.github.com/users/mdmahmudurrahman/followers","following_url":"https://api.github.com/users/mdmahmudurrahman/following{/other_user}","gists_url":"https://api.github.com/users/mdmahmudurrahman/gists{/gist_id}","starred_url":"https://api.github.com/users/mdmahmudurrahman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdmahmudurrahman/subscriptions","organizations_url":"https://api.github.com/users/mdmahmudurrahman/orgs","repos_url":"https://api.github.com/users/mdmahmudurrahman/repos","events_url":"https://api.github.com/users/mdmahmudurrahman/events{/privacy}","received_events_url":"https://api.github.com/users/mdmahmudurrahman/received_events","type":"User","site_admin":false},"body":"Can you re-write using the following\r\n```ruby\r\nreturn if current_user&.staff? || current_user&.admin?\r\nflash[:warning] = t \"users.invalid_action\"\r\nredirect_to root_path\r\n```","created_at":"2018-07-31T09:42:24Z","updated_at":"2018-07-31T09:49:18Z","html_url":"https://github.com/framgia/hotel-management/pull/11#discussion_r206461268","pull_request_url":"https://api.github.com/repos/framgia/hotel-management/pulls/11","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/comments/206461268"},"html":{"href":"https://github.com/framgia/hotel-management/pull/11#discussion_r206461268"},"pull_request":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/hotel-management/pulls/11","id":204709688,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NzA5Njg4","html_url":"https://github.com/framgia/hotel-management/pull/11","diff_url":"https://github.com/framgia/hotel-management/pull/11.diff","patch_url":"https://github.com/framgia/hotel-management/pull/11.patch","issue_url":"https://api.github.com/repos/framgia/hotel-management/issues/11","number":11,"state":"open","locked":false,"title":"Permission user","user":{"login":"phucynwa","id":32135551,"node_id":"MDQ6VXNlcjMyMTM1NTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32135551?v=4","gravatar_id":"","url":"https://api.github.com/users/phucynwa","html_url":"https://github.com/phucynwa","followers_url":"https://api.github.com/users/phucynwa/followers","following_url":"https://api.github.com/users/phucynwa/following{/other_user}","gists_url":"https://api.github.com/users/phucynwa/gists{/gist_id}","starred_url":"https://api.github.com/users/phucynwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phucynwa/subscriptions","organizations_url":"https://api.github.com/users/phucynwa/orgs","repos_url":"https://api.github.com/users/phucynwa/repos","events_url":"https://api.github.com/users/phucynwa/events{/privacy}","received_events_url":"https://api.github.com/users/phucynwa/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-30T06:52:51Z","updated_at":"2018-07-31T09:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e12244d2bfda817eae75850ae4f640874e6759b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/hotel-management/pulls/11/commits","review_comments_url":"https://api.github.com/repos/framgia/hotel-management/pulls/11/comments","review_comment_url":"https://api.github.com/repos/framgia/hotel-management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/hotel-management/issues/11/comments","statuses_url":"https://api.github.com/repos/framgia/hotel-management/statuses/c673907880b23987fde59110ce3f2280c102f102","head":{"label":"phucynwa:permission-user","ref":"permission-user","sha":"c673907880b23987fde59110ce3f2280c102f102","user":{"login":"phucynwa","id":32135551,"node_id":"MDQ6VXNlcjMyMTM1NTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32135551?v=4","gravatar_id":"","url":"https://api.github.com/users/phucynwa","html_url":"https://github.com/phucynwa","followers_url":"https://api.github.com/users/phucynwa/followers","following_url":"https://api.github.com/users/phucynwa/following{/other_user}","gists_url":"https://api.github.com/users/phucynwa/gists{/gist_id}","starred_url":"https://api.github.com/users/phucynwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phucynwa/subscriptions","organizations_url":"https://api.github.com/users/phucynwa/orgs","repos_url":"https://api.github.com/users/phucynwa/repos","events_url":"https://api.github.com/users/phucynwa/events{/privacy}","received_events_url":"https://api.github.com/users/phucynwa/received_events","type":"User","site_admin":false},"repo":{"id":142254653,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIyNTQ2NTM=","name":"hotel-management","full_name":"phucynwa/hotel-management","owner":{"login":"phucynwa","id":32135551,"node_id":"MDQ6VXNlcjMyMTM1NTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32135551?v=4","gravatar_id":"","url":"https://api.github.com/users/phucynwa","html_url":"https://github.com/phucynwa","followers_url":"https://api.github.com/users/phucynwa/followers","following_url":"https://api.github.com/users/phucynwa/following{/other_user}","gists_url":"https://api.github.com/users/phucynwa/gists{/gist_id}","starred_url":"https://api.github.com/users/phucynwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phucynwa/subscriptions","organizations_url":"https://api.github.com/users/phucynwa/orgs","repos_url":"https://api.github.com/users/phucynwa/repos","events_url":"https://api.github.com/users/phucynwa/events{/privacy}","received_events_url":"https://api.github.com/users/phucynwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phucynwa/hotel-management","description":null,"fork":true,"url":"https://api.github.com/repos/phucynwa/hotel-management","forks_url":"https://api.github.com/repos/phucynwa/hotel-management/forks","keys_url":"https://api.github.com/repos/phucynwa/hotel-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phucynwa/hotel-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phucynwa/hotel-management/teams","hooks_url":"https://api.github.com/repos/phucynwa/hotel-management/hooks","issue_events_url":"https://api.github.com/repos/phucynwa/hotel-management/issues/events{/number}","events_url":"https://api.github.com/repos/phucynwa/hotel-management/events","assignees_url":"https://api.github.com/repos/phucynwa/hotel-management/assignees{/user}","branches_url":"https://api.github.com/repos/phucynwa/hotel-management/branches{/branch}","tags_url":"https://api.github.com/repos/phucynwa/hotel-management/tags","blobs_url":"https://api.github.com/repos/phucynwa/hotel-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phucynwa/hotel-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phucynwa/hotel-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/phucynwa/hotel-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phucynwa/hotel-management/statuses/{sha}","languages_url":"https://api.github.com/repos/phucynwa/hotel-management/languages","stargazers_url":"https://api.github.com/repos/phucynwa/hotel-management/stargazers","contributors_url":"https://api.github.com/repos/phucynwa/hotel-management/contributors","subscribers_url":"https://api.github.com/repos/phucynwa/hotel-management/subscribers","subscription_url":"https://api.github.com/repos/phucynwa/hotel-management/subscription","commits_url":"https://api.github.com/repos/phucynwa/hotel-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/phucynwa/hotel-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/phucynwa/hotel-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/phucynwa/hotel-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/phucynwa/hotel-management/contents/{+path}","compare_url":"https://api.github.com/repos/phucynwa/hotel-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phucynwa/hotel-management/merges","archive_url":"https://api.github.com/repos/phucynwa/hotel-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phucynwa/hotel-management/downloads","issues_url":"https://api.github.com/repos/phucynwa/hotel-management/issues{/number}","pulls_url":"https://api.github.com/repos/phucynwa/hotel-management/pulls{/number}","milestones_url":"https://api.github.com/repos/phucynwa/hotel-management/milestones{/number}","notifications_url":"https://api.github.com/repos/phucynwa/hotel-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phucynwa/hotel-management/labels{/name}","releases_url":"https://api.github.com/repos/phucynwa/hotel-management/releases{/id}","deployments_url":"https://api.github.com/repos/phucynwa/hotel-management/deployments","created_at":"2018-07-25T06:04:18Z","updated_at":"2018-07-25T06:42:29Z","pushed_at":"2018-07-31T09:16:08Z","git_url":"git://github.com/phucynwa/hotel-management.git","ssh_url":"git@github.com:phucynwa/hotel-management.git","clone_url":"https://github.com/phucynwa/hotel-management.git","svn_url":"https://github.com/phucynwa/hotel-management","homepage":null,"size":532,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:master","ref":"master","sha":"042da1d000cd388b26eb2e5fae18d8118974a9b9","user":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":142127111,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIxMjcxMTE=","name":"hotel-management","full_name":"framgia/hotel-management","owner":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/hotel-management","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/hotel-management","forks_url":"https://api.github.com/repos/framgia/hotel-management/forks","keys_url":"https://api.github.com/repos/framgia/hotel-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/hotel-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/hotel-management/teams","hooks_url":"https://api.github.com/repos/framgia/hotel-management/hooks","issue_events_url":"https://api.github.com/repos/framgia/hotel-management/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/hotel-management/events","assignees_url":"https://api.github.com/repos/framgia/hotel-management/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/hotel-management/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/hotel-management/tags","blobs_url":"https://api.github.com/repos/framgia/hotel-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/hotel-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/hotel-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/hotel-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/hotel-management/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/hotel-management/languages","stargazers_url":"https://api.github.com/repos/framgia/hotel-management/stargazers","contributors_url":"https://api.github.com/repos/framgia/hotel-management/contributors","subscribers_url":"https://api.github.com/repos/framgia/hotel-management/subscribers","subscription_url":"https://api.github.com/repos/framgia/hotel-management/subscription","commits_url":"https://api.github.com/repos/framgia/hotel-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/hotel-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/hotel-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/hotel-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/hotel-management/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/hotel-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/hotel-management/merges","archive_url":"https://api.github.com/repos/framgia/hotel-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/hotel-management/downloads","issues_url":"https://api.github.com/repos/framgia/hotel-management/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/hotel-management/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/hotel-management/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/hotel-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/hotel-management/labels{/name}","releases_url":"https://api.github.com/repos/framgia/hotel-management/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/hotel-management/deployments","created_at":"2018-07-24T08:15:28Z","updated_at":"2018-07-31T08:20:12Z","pushed_at":"2018-07-31T09:16:09Z","git_url":"git://github.com/framgia/hotel-management.git","ssh_url":"git@github.com:framgia/hotel-management.git","clone_url":"https://github.com/framgia/hotel-management.git","svn_url":"https://github.com/framgia/hotel-management","homepage":null,"size":77,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/11"},"html":{"href":"https://github.com/framgia/hotel-management/pull/11"},"issue":{"href":"https://api.github.com/repos/framgia/hotel-management/issues/11"},"comments":{"href":"https://api.github.com/repos/framgia/hotel-management/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/hotel-management/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/hotel-management/statuses/c673907880b23987fde59110ce3f2280c102f102"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mdmahmudurrahman"}}