{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/36609379","id":36609379,"diff_hunk":"@@ -17,7 +17,7 @@ def index\n         elsif name\n           @permissions = Permission.where(:name => name)\n         else\n-          @permissions = Permission.all\n+          @permissions = resource_scope_for_index\n         end\n         @permissions = @permissions.paginate(paginate_options)","path":"app/controllers/api/v2/permissions_controller.rb","position":7,"original_position":7,"commit_id":"2666d0558870c7e645edc9051ff90dc9d6cabdce","original_commit_id":"2666d0558870c7e645edc9051ff90dc9d6cabdce","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"body":".paginate will be called twice, since resource_scope_for_index calls it","created_at":"2015-08-10T08:08:56Z","updated_at":"2015-08-10T08:08:56Z","html_url":"https://github.com/theforeman/foreman/pull/2595#discussion_r36609379","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/2595","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/36609379"},"html":{"href":"https://github.com/theforeman/foreman/pull/2595#discussion_r36609379"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2595"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2595","id":41894654,"html_url":"https://github.com/theforeman/foreman/pull/2595","diff_url":"https://github.com/theforeman/foreman/pull/2595.diff","patch_url":"https://github.com/theforeman/foreman/pull/2595.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2595","number":2595,"state":"open","locked":false,"title":"Fixes #11303: Allow scoped search by name for permissions.","user":{"login":"ehelms","id":293363,"avatar_url":"https://avatars.githubusercontent.com/u/293363?v=3","gravatar_id":"","url":"https://api.github.com/users/ehelms","html_url":"https://github.com/ehelms","followers_url":"https://api.github.com/users/ehelms/followers","following_url":"https://api.github.com/users/ehelms/following{/other_user}","gists_url":"https://api.github.com/users/ehelms/gists{/gist_id}","starred_url":"https://api.github.com/users/ehelms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehelms/subscriptions","organizations_url":"https://api.github.com/users/ehelms/orgs","repos_url":"https://api.github.com/users/ehelms/repos","events_url":"https://api.github.com/users/ehelms/events{/privacy}","received_events_url":"https://api.github.com/users/ehelms/received_events","type":"User","site_admin":false},"body":"This both provides this functionality and fixes an issue with creating\r\nfilters using hammer. Hammer attempts to search for a permission by\r\nname using scoped search syntax when creating a filter with the\r\n--permission=view_domains style syntax. However, this was defaulting to\r\nreturning all permissions instead of scoped permissions.","created_at":"2015-08-07T14:02:02Z","updated_at":"2015-08-10T08:08:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d652dc10a69cdcbbff5c1b23a00a67c76b4761bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/2595/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/2595/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2595/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/2666d0558870c7e645edc9051ff90dc9d6cabdce","head":{"label":"ehelms:fixes-11303","ref":"fixes-11303","sha":"2666d0558870c7e645edc9051ff90dc9d6cabdce","user":{"login":"ehelms","id":293363,"avatar_url":"https://avatars.githubusercontent.com/u/293363?v=3","gravatar_id":"","url":"https://api.github.com/users/ehelms","html_url":"https://github.com/ehelms","followers_url":"https://api.github.com/users/ehelms/followers","following_url":"https://api.github.com/users/ehelms/following{/other_user}","gists_url":"https://api.github.com/users/ehelms/gists{/gist_id}","starred_url":"https://api.github.com/users/ehelms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehelms/subscriptions","organizations_url":"https://api.github.com/users/ehelms/orgs","repos_url":"https://api.github.com/users/ehelms/repos","events_url":"https://api.github.com/users/ehelms/events{/privacy}","received_events_url":"https://api.github.com/users/ehelms/received_events","type":"User","site_admin":false},"repo":{"id":11512427,"name":"foreman","full_name":"ehelms/foreman","owner":{"login":"ehelms","id":293363,"avatar_url":"https://avatars.githubusercontent.com/u/293363?v=3","gravatar_id":"","url":"https://api.github.com/users/ehelms","html_url":"https://github.com/ehelms","followers_url":"https://api.github.com/users/ehelms/followers","following_url":"https://api.github.com/users/ehelms/following{/other_user}","gists_url":"https://api.github.com/users/ehelms/gists{/gist_id}","starred_url":"https://api.github.com/users/ehelms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehelms/subscriptions","organizations_url":"https://api.github.com/users/ehelms/orgs","repos_url":"https://api.github.com/users/ehelms/repos","events_url":"https://api.github.com/users/ehelms/events{/privacy}","received_events_url":"https://api.github.com/users/ehelms/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ehelms/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/ehelms/foreman","forks_url":"https://api.github.com/repos/ehelms/foreman/forks","keys_url":"https://api.github.com/repos/ehelms/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehelms/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehelms/foreman/teams","hooks_url":"https://api.github.com/repos/ehelms/foreman/hooks","issue_events_url":"https://api.github.com/repos/ehelms/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/ehelms/foreman/events","assignees_url":"https://api.github.com/repos/ehelms/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/ehelms/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/ehelms/foreman/tags","blobs_url":"https://api.github.com/repos/ehelms/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehelms/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehelms/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehelms/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehelms/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/ehelms/foreman/languages","stargazers_url":"https://api.github.com/repos/ehelms/foreman/stargazers","contributors_url":"https://api.github.com/repos/ehelms/foreman/contributors","subscribers_url":"https://api.github.com/repos/ehelms/foreman/subscribers","subscription_url":"https://api.github.com/repos/ehelms/foreman/subscription","commits_url":"https://api.github.com/repos/ehelms/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehelms/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehelms/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehelms/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehelms/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/ehelms/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehelms/foreman/merges","archive_url":"https://api.github.com/repos/ehelms/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehelms/foreman/downloads","issues_url":"https://api.github.com/repos/ehelms/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/ehelms/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/ehelms/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/ehelms/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehelms/foreman/labels{/name}","releases_url":"https://api.github.com/repos/ehelms/foreman/releases{/id}","created_at":"2013-07-18T20:03:01Z","updated_at":"2014-06-24T18:53:10Z","pushed_at":"2015-08-07T14:01:49Z","git_url":"git://github.com/ehelms/foreman.git","ssh_url":"git@github.com:ehelms/foreman.git","clone_url":"https://github.com/ehelms/foreman.git","svn_url":"https://github.com/ehelms/foreman","homepage":"http://theforeman.org","size":25359,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"3bd9a898a0a31ca87066c0a8967444523fb0e88c","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","created_at":"2009-07-23T15:07:00Z","updated_at":"2015-08-09T13:47:40Z","pushed_at":"2015-08-09T11:37:07Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":84005,"stargazers_count":822,"watchers_count":822,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":420,"mirror_url":null,"open_issues_count":85,"forks":420,"open_issues":85,"watchers":822,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2595"},"html":{"href":"https://github.com/theforeman/foreman/pull/2595"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2595"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2595/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2595/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2595/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/2666d0558870c7e645edc9051ff90dc9d6cabdce"}}}}