{"action":"created","comment":{"url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/comments/114571256","pull_request_review_id":36048982,"id":114571256,"diff_hunk":"@@ -11,21 +13,32 @@ public class ContactController : Controller\n     {\n         private readonly IRepository<Contact> _contactRepository;\n         private readonly IRepository<ContactArea> _contactAreaRepository;\n+        private readonly IWorkContext _workContext;\n \n-        public ContactController(IRepository<Contact> contactRepository, IRepository<ContactArea> contactAreaRepository)\n+        public ContactController(IRepository<Contact> contactRepository, IRepository<ContactArea> contactAreaRepository, IWorkContext workContext)\n         {\n             _contactRepository = contactRepository;\n             _contactAreaRepository = contactAreaRepository;\n+            _workContext = workContext;\n         }\n \n         [Route(\"contact\")]\n-        public IActionResult Index()\n+        public async Task<IActionResult> Index()\n         {\n             var model = new ContactVm()\n             {\n                 ContactAreas = GetContactArea()\n             };\n \n+            var currentUser = await _workContext.GetCurrentUser();\n+            \n+            if(!(currentUser.Roles.Count == 1 && currentUser.Roles.First().RoleId == 3))","path":"src/Modules/SimplCommerce.Module.Contacts/Controllers/ContactController.cs","position":35,"original_position":35,"commit_id":"cea13aa4ab1807987582fef4dd75c1ddd5499bda","original_commit_id":"cea13aa4ab1807987582fef4dd75c1ddd5499bda","user":{"login":"thiennn","id":289607,"avatar_url":"https://avatars0.githubusercontent.com/u/289607?v=3","gravatar_id":"","url":"https://api.github.com/users/thiennn","html_url":"https://github.com/thiennn","followers_url":"https://api.github.com/users/thiennn/followers","following_url":"https://api.github.com/users/thiennn/following{/other_user}","gists_url":"https://api.github.com/users/thiennn/gists{/gist_id}","starred_url":"https://api.github.com/users/thiennn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiennn/subscriptions","organizations_url":"https://api.github.com/users/thiennn/orgs","repos_url":"https://api.github.com/users/thiennn/repos","events_url":"https://api.github.com/users/thiennn/events{/privacy}","received_events_url":"https://api.github.com/users/thiennn/received_events","type":"User","site_admin":false},"body":"I think if(User.Identity.IsAuthenticated) is better","created_at":"2017-05-03T15:12:10Z","updated_at":"2017-05-03T15:12:10Z","html_url":"https://github.com/simplcommerce/SimplCommerce/pull/188#discussion_r114571256","pull_request_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188","_links":{"self":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/comments/114571256"},"html":{"href":"https://github.com/simplcommerce/SimplCommerce/pull/188#discussion_r114571256"},"pull_request":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188"}}},"pull_request":{"url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188","id":118675491,"html_url":"https://github.com/simplcommerce/SimplCommerce/pull/188","diff_url":"https://github.com/simplcommerce/SimplCommerce/pull/188.diff","patch_url":"https://github.com/simplcommerce/SimplCommerce/pull/188.patch","issue_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/188","number":188,"state":"open","locked":false,"title":"#183 Add auto fill in User info","user":{"login":"duykhuongkid","id":10249434,"avatar_url":"https://avatars3.githubusercontent.com/u/10249434?v=3","gravatar_id":"","url":"https://api.github.com/users/duykhuongkid","html_url":"https://github.com/duykhuongkid","followers_url":"https://api.github.com/users/duykhuongkid/followers","following_url":"https://api.github.com/users/duykhuongkid/following{/other_user}","gists_url":"https://api.github.com/users/duykhuongkid/gists{/gist_id}","starred_url":"https://api.github.com/users/duykhuongkid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duykhuongkid/subscriptions","organizations_url":"https://api.github.com/users/duykhuongkid/orgs","repos_url":"https://api.github.com/users/duykhuongkid/repos","events_url":"https://api.github.com/users/duykhuongkid/events{/privacy}","received_events_url":"https://api.github.com/users/duykhuongkid/received_events","type":"User","site_admin":false},"body":"Hi a Thien, \r\n\r\nI have tried to get the User Role when they logged but unsuccessful because of the method GetUserAsync doesnot include Roles when getting data. Therefore I'm using the condition below. \r\n\r\nThanks,\r\nKhuong Phan","created_at":"2017-05-03T00:51:26Z","updated_at":"2017-05-03T15:12:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1dc44329148f9a94f12bbf8fc5557b006ebf3bb1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188/commits","review_comments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188/comments","review_comment_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/188/comments","statuses_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/statuses/cea13aa4ab1807987582fef4dd75c1ddd5499bda","head":{"label":"simplcommerce:fix-contact-auto-fill-in-user-info","ref":"fix-contact-auto-fill-in-user-info","sha":"cea13aa4ab1807987582fef4dd75c1ddd5499bda","user":{"login":"simplcommerce","id":19270027,"avatar_url":"https://avatars2.githubusercontent.com/u/19270027?v=3","gravatar_id":"","url":"https://api.github.com/users/simplcommerce","html_url":"https://github.com/simplcommerce","followers_url":"https://api.github.com/users/simplcommerce/followers","following_url":"https://api.github.com/users/simplcommerce/following{/other_user}","gists_url":"https://api.github.com/users/simplcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/simplcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplcommerce/subscriptions","organizations_url":"https://api.github.com/users/simplcommerce/orgs","repos_url":"https://api.github.com/users/simplcommerce/repos","events_url":"https://api.github.com/users/simplcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/simplcommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":59361967,"name":"SimplCommerce","full_name":"simplcommerce/SimplCommerce","owner":{"login":"simplcommerce","id":19270027,"avatar_url":"https://avatars2.githubusercontent.com/u/19270027?v=3","gravatar_id":"","url":"https://api.github.com/users/simplcommerce","html_url":"https://github.com/simplcommerce","followers_url":"https://api.github.com/users/simplcommerce/followers","following_url":"https://api.github.com/users/simplcommerce/following{/other_user}","gists_url":"https://api.github.com/users/simplcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/simplcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplcommerce/subscriptions","organizations_url":"https://api.github.com/users/simplcommerce/orgs","repos_url":"https://api.github.com/users/simplcommerce/repos","events_url":"https://api.github.com/users/simplcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/simplcommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplcommerce/SimplCommerce","description":"A simple, cross platform, modularized ecommerce system built on .NET Core","fork":false,"url":"https://api.github.com/repos/simplcommerce/SimplCommerce","forks_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/forks","keys_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/teams","hooks_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/hooks","issue_events_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/events{/number}","events_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/events","assignees_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/assignees{/user}","branches_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/branches{/branch}","tags_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/tags","blobs_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/languages","stargazers_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/stargazers","contributors_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/contributors","subscribers_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/subscribers","subscription_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/subscription","commits_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/contents/{+path}","compare_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/merges","archive_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/downloads","issues_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues{/number}","pulls_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/labels{/name}","releases_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/releases{/id}","deployments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/deployments","created_at":"2016-05-21T13:43:01Z","updated_at":"2017-05-01T16:49:57Z","pushed_at":"2017-05-03T00:51:26Z","git_url":"git://github.com/simplcommerce/SimplCommerce.git","ssh_url":"git@github.com:simplcommerce/SimplCommerce.git","clone_url":"https://github.com/simplcommerce/SimplCommerce.git","svn_url":"https://github.com/simplcommerce/SimplCommerce","homepage":"http://www.simplcommerce.com","size":12896,"stargazers_count":621,"watchers_count":621,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":36,"forks":202,"open_issues":36,"watchers":621,"default_branch":"master"}},"base":{"label":"simplcommerce:master","ref":"master","sha":"bf8f54f5d4a7e74b13d22f11bfb07437cbc48e47","user":{"login":"simplcommerce","id":19270027,"avatar_url":"https://avatars2.githubusercontent.com/u/19270027?v=3","gravatar_id":"","url":"https://api.github.com/users/simplcommerce","html_url":"https://github.com/simplcommerce","followers_url":"https://api.github.com/users/simplcommerce/followers","following_url":"https://api.github.com/users/simplcommerce/following{/other_user}","gists_url":"https://api.github.com/users/simplcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/simplcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplcommerce/subscriptions","organizations_url":"https://api.github.com/users/simplcommerce/orgs","repos_url":"https://api.github.com/users/simplcommerce/repos","events_url":"https://api.github.com/users/simplcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/simplcommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":59361967,"name":"SimplCommerce","full_name":"simplcommerce/SimplCommerce","owner":{"login":"simplcommerce","id":19270027,"avatar_url":"https://avatars2.githubusercontent.com/u/19270027?v=3","gravatar_id":"","url":"https://api.github.com/users/simplcommerce","html_url":"https://github.com/simplcommerce","followers_url":"https://api.github.com/users/simplcommerce/followers","following_url":"https://api.github.com/users/simplcommerce/following{/other_user}","gists_url":"https://api.github.com/users/simplcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/simplcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplcommerce/subscriptions","organizations_url":"https://api.github.com/users/simplcommerce/orgs","repos_url":"https://api.github.com/users/simplcommerce/repos","events_url":"https://api.github.com/users/simplcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/simplcommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplcommerce/SimplCommerce","description":"A simple, cross platform, modularized ecommerce system built on .NET Core","fork":false,"url":"https://api.github.com/repos/simplcommerce/SimplCommerce","forks_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/forks","keys_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/teams","hooks_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/hooks","issue_events_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/events{/number}","events_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/events","assignees_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/assignees{/user}","branches_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/branches{/branch}","tags_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/tags","blobs_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/languages","stargazers_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/stargazers","contributors_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/contributors","subscribers_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/subscribers","subscription_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/subscription","commits_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/contents/{+path}","compare_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/merges","archive_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/downloads","issues_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues{/number}","pulls_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/labels{/name}","releases_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/releases{/id}","deployments_url":"https://api.github.com/repos/simplcommerce/SimplCommerce/deployments","created_at":"2016-05-21T13:43:01Z","updated_at":"2017-05-01T16:49:57Z","pushed_at":"2017-05-03T00:51:26Z","git_url":"git://github.com/simplcommerce/SimplCommerce.git","ssh_url":"git@github.com:simplcommerce/SimplCommerce.git","clone_url":"https://github.com/simplcommerce/SimplCommerce.git","svn_url":"https://github.com/simplcommerce/SimplCommerce","homepage":"http://www.simplcommerce.com","size":12896,"stargazers_count":621,"watchers_count":621,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":36,"forks":202,"open_issues":36,"watchers":621,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188"},"html":{"href":"https://github.com/simplcommerce/SimplCommerce/pull/188"},"issue":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/188"},"comments":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/simplcommerce/SimplCommerce/statuses/cea13aa4ab1807987582fef4dd75c1ddd5499bda"}}}}
{"actor":{"display_login":"thiennn"}}