{"action":"created","comment":{"url":"https://api.github.com/repos/cyverse/DE/pulls/comments/67211835","id":67211835,"diff_hunk":"@@ -127,35 +147,41 @@ func UpdateResource(tx *sql.Tx, id *string, name *string) (*models.ResourceOut,\n \trow := tx.QueryRow(query, name, id)\n \n \t// Return the result.\n-\tvar resource models.ResourceOut\n-\tif err := row.Scan(&resource.ID, &resource.Name, &resource.ResourceType); err != nil {\n-\t\treturn nil, err\n-\t}\n-\treturn &resource, nil\n+\treturn rowToResource(row)\n }\n \n-func ListResources(tx *sql.Tx) ([]*models.ResourceOut, error) {\n+func ListResources(tx *sql.Tx, resourceTypeName, resourceName *string) ([]*models.ResourceOut, error) {\n \n \t// Query the database.\n-\tquery := `SELECT r.id, r.name, t.name AS resource_type\n+\tvar rows *sql.Rows\n+\tvar err error\n+\tif resourceTypeName != nil && resourceName != nil {","path":"golang/src/permissions/restapi/impl/db/resources.go","position":154,"original_position":154,"commit_id":"2b4c2722e7979c998426deb2197ce387cb1cdcf7","original_commit_id":"2b4c2722e7979c998426deb2197ce387cb1cdcf7","user":{"login":"dennisroberts71","id":415143,"avatar_url":"https://avatars.githubusercontent.com/u/415143?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisroberts71","html_url":"https://github.com/dennisroberts71","followers_url":"https://api.github.com/users/dennisroberts71/followers","following_url":"https://api.github.com/users/dennisroberts71/following{/other_user}","gists_url":"https://api.github.com/users/dennisroberts71/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisroberts71/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisroberts71/subscriptions","organizations_url":"https://api.github.com/users/dennisroberts71/orgs","repos_url":"https://api.github.com/users/dennisroberts71/repos","events_url":"https://api.github.com/users/dennisroberts71/events{/privacy}","received_events_url":"https://api.github.com/users/dennisroberts71/received_events","type":"User","site_admin":false},"body":"That does sound useful, and query generation libraries have worked out fairly well for us in Clojure. I'm going to leave this as-is for the time being, but this does sound like a useful change for the future.","created_at":"2016-06-15T17:55:24Z","updated_at":"2016-06-15T17:55:24Z","html_url":"https://github.com/cyverse/DE/pull/218#discussion_r67211835","pull_request_url":"https://api.github.com/repos/cyverse/DE/pulls/218","_links":{"self":{"href":"https://api.github.com/repos/cyverse/DE/pulls/comments/67211835"},"html":{"href":"https://github.com/cyverse/DE/pull/218#discussion_r67211835"},"pull_request":{"href":"https://api.github.com/repos/cyverse/DE/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/cyverse/DE/pulls/218","id":73454687,"html_url":"https://github.com/cyverse/DE/pull/218","diff_url":"https://github.com/cyverse/DE/pull/218.diff","patch_url":"https://github.com/cyverse/DE/pull/218.patch","issue_url":"https://api.github.com/repos/cyverse/DE/issues/218","number":218,"state":"open","locked":false,"title":"Perms refactor","user":{"login":"dennisroberts71","id":415143,"avatar_url":"https://avatars.githubusercontent.com/u/415143?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisroberts71","html_url":"https://github.com/dennisroberts71","followers_url":"https://api.github.com/users/dennisroberts71/followers","following_url":"https://api.github.com/users/dennisroberts71/following{/other_user}","gists_url":"https://api.github.com/users/dennisroberts71/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisroberts71/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisroberts71/subscriptions","organizations_url":"https://api.github.com/users/dennisroberts71/orgs","repos_url":"https://api.github.com/users/dennisroberts71/repos","events_url":"https://api.github.com/users/dennisroberts71/events{/privacy}","received_events_url":"https://api.github.com/users/dennisroberts71/received_events","type":"User","site_admin":false},"body":"This change adds several new features to the permissions service and modifies the apps service to use the new permissions service. I haven't completely finished testing the changes to the apps service yet. I'll be adding some new integration tests next week. I wanted to get some eyes on this as soon as I could, though.\r\n\r\nThe most complicated (and least well tested) part of this PR is the `apps` service, so I'd like a slightly closer evaluation of these changes if possible. I'm going to modifying the existing integration tests to work with the new permissions service next week.","created_at":"2016-06-11T01:26:15Z","updated_at":"2016-06-15T17:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a479955f1c31dcae217338578582f55ff74f9772","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cyverse/DE/pulls/218/commits","review_comments_url":"https://api.github.com/repos/cyverse/DE/pulls/218/comments","review_comment_url":"https://api.github.com/repos/cyverse/DE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cyverse/DE/issues/218/comments","statuses_url":"https://api.github.com/repos/cyverse/DE/statuses/2b4c2722e7979c998426deb2197ce387cb1cdcf7","head":{"label":"cyverse:perms-refactor","ref":"perms-refactor","sha":"2b4c2722e7979c998426deb2197ce387cb1cdcf7","user":{"login":"cyverse","id":15638129,"avatar_url":"https://avatars.githubusercontent.com/u/15638129?v=3","gravatar_id":"","url":"https://api.github.com/users/cyverse","html_url":"https://github.com/cyverse","followers_url":"https://api.github.com/users/cyverse/followers","following_url":"https://api.github.com/users/cyverse/following{/other_user}","gists_url":"https://api.github.com/users/cyverse/gists{/gist_id}","starred_url":"https://api.github.com/users/cyverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyverse/subscriptions","organizations_url":"https://api.github.com/users/cyverse/orgs","repos_url":"https://api.github.com/users/cyverse/repos","events_url":"https://api.github.com/users/cyverse/events{/privacy}","received_events_url":"https://api.github.com/users/cyverse/received_events","type":"Organization","site_admin":false},"repo":{"id":45433519,"name":"DE","full_name":"cyverse/DE","owner":{"login":"cyverse","id":15638129,"avatar_url":"https://avatars.githubusercontent.com/u/15638129?v=3","gravatar_id":"","url":"https://api.github.com/users/cyverse","html_url":"https://github.com/cyverse","followers_url":"https://api.github.com/users/cyverse/followers","following_url":"https://api.github.com/users/cyverse/following{/other_user}","gists_url":"https://api.github.com/users/cyverse/gists{/gist_id}","starred_url":"https://api.github.com/users/cyverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyverse/subscriptions","organizations_url":"https://api.github.com/users/cyverse/orgs","repos_url":"https://api.github.com/users/cyverse/repos","events_url":"https://api.github.com/users/cyverse/events{/privacy}","received_events_url":"https://api.github.com/users/cyverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cyverse/DE","description":"The CyVerse Discovery Environment","fork":false,"url":"https://api.github.com/repos/cyverse/DE","forks_url":"https://api.github.com/repos/cyverse/DE/forks","keys_url":"https://api.github.com/repos/cyverse/DE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyverse/DE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyverse/DE/teams","hooks_url":"https://api.github.com/repos/cyverse/DE/hooks","issue_events_url":"https://api.github.com/repos/cyverse/DE/issues/events{/number}","events_url":"https://api.github.com/repos/cyverse/DE/events","assignees_url":"https://api.github.com/repos/cyverse/DE/assignees{/user}","branches_url":"https://api.github.com/repos/cyverse/DE/branches{/branch}","tags_url":"https://api.github.com/repos/cyverse/DE/tags","blobs_url":"https://api.github.com/repos/cyverse/DE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyverse/DE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyverse/DE/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyverse/DE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyverse/DE/statuses/{sha}","languages_url":"https://api.github.com/repos/cyverse/DE/languages","stargazers_url":"https://api.github.com/repos/cyverse/DE/stargazers","contributors_url":"https://api.github.com/repos/cyverse/DE/contributors","subscribers_url":"https://api.github.com/repos/cyverse/DE/subscribers","subscription_url":"https://api.github.com/repos/cyverse/DE/subscription","commits_url":"https://api.github.com/repos/cyverse/DE/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyverse/DE/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyverse/DE/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyverse/DE/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyverse/DE/contents/{+path}","compare_url":"https://api.github.com/repos/cyverse/DE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyverse/DE/merges","archive_url":"https://api.github.com/repos/cyverse/DE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyverse/DE/downloads","issues_url":"https://api.github.com/repos/cyverse/DE/issues{/number}","pulls_url":"https://api.github.com/repos/cyverse/DE/pulls{/number}","milestones_url":"https://api.github.com/repos/cyverse/DE/milestones{/number}","notifications_url":"https://api.github.com/repos/cyverse/DE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyverse/DE/labels{/name}","releases_url":"https://api.github.com/repos/cyverse/DE/releases{/id}","deployments_url":"https://api.github.com/repos/cyverse/DE/deployments","created_at":"2015-11-03T01:27:41Z","updated_at":"2016-03-05T02:16:59Z","pushed_at":"2016-06-15T17:37:36Z","git_url":"git://github.com/cyverse/DE.git","ssh_url":"git@github.com:cyverse/DE.git","clone_url":"https://github.com/cyverse/DE.git","svn_url":"https://github.com/cyverse/DE","homepage":"https://de.iplantcollaborative.org/de/","size":42365,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":4,"default_branch":"master"}},"base":{"label":"cyverse:dev","ref":"dev","sha":"ee853b9bbae8be256ed6c7fc73386ef8a13bec08","user":{"login":"cyverse","id":15638129,"avatar_url":"https://avatars.githubusercontent.com/u/15638129?v=3","gravatar_id":"","url":"https://api.github.com/users/cyverse","html_url":"https://github.com/cyverse","followers_url":"https://api.github.com/users/cyverse/followers","following_url":"https://api.github.com/users/cyverse/following{/other_user}","gists_url":"https://api.github.com/users/cyverse/gists{/gist_id}","starred_url":"https://api.github.com/users/cyverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyverse/subscriptions","organizations_url":"https://api.github.com/users/cyverse/orgs","repos_url":"https://api.github.com/users/cyverse/repos","events_url":"https://api.github.com/users/cyverse/events{/privacy}","received_events_url":"https://api.github.com/users/cyverse/received_events","type":"Organization","site_admin":false},"repo":{"id":45433519,"name":"DE","full_name":"cyverse/DE","owner":{"login":"cyverse","id":15638129,"avatar_url":"https://avatars.githubusercontent.com/u/15638129?v=3","gravatar_id":"","url":"https://api.github.com/users/cyverse","html_url":"https://github.com/cyverse","followers_url":"https://api.github.com/users/cyverse/followers","following_url":"https://api.github.com/users/cyverse/following{/other_user}","gists_url":"https://api.github.com/users/cyverse/gists{/gist_id}","starred_url":"https://api.github.com/users/cyverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyverse/subscriptions","organizations_url":"https://api.github.com/users/cyverse/orgs","repos_url":"https://api.github.com/users/cyverse/repos","events_url":"https://api.github.com/users/cyverse/events{/privacy}","received_events_url":"https://api.github.com/users/cyverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cyverse/DE","description":"The CyVerse Discovery Environment","fork":false,"url":"https://api.github.com/repos/cyverse/DE","forks_url":"https://api.github.com/repos/cyverse/DE/forks","keys_url":"https://api.github.com/repos/cyverse/DE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyverse/DE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyverse/DE/teams","hooks_url":"https://api.github.com/repos/cyverse/DE/hooks","issue_events_url":"https://api.github.com/repos/cyverse/DE/issues/events{/number}","events_url":"https://api.github.com/repos/cyverse/DE/events","assignees_url":"https://api.github.com/repos/cyverse/DE/assignees{/user}","branches_url":"https://api.github.com/repos/cyverse/DE/branches{/branch}","tags_url":"https://api.github.com/repos/cyverse/DE/tags","blobs_url":"https://api.github.com/repos/cyverse/DE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyverse/DE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyverse/DE/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyverse/DE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyverse/DE/statuses/{sha}","languages_url":"https://api.github.com/repos/cyverse/DE/languages","stargazers_url":"https://api.github.com/repos/cyverse/DE/stargazers","contributors_url":"https://api.github.com/repos/cyverse/DE/contributors","subscribers_url":"https://api.github.com/repos/cyverse/DE/subscribers","subscription_url":"https://api.github.com/repos/cyverse/DE/subscription","commits_url":"https://api.github.com/repos/cyverse/DE/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyverse/DE/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyverse/DE/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyverse/DE/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyverse/DE/contents/{+path}","compare_url":"https://api.github.com/repos/cyverse/DE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyverse/DE/merges","archive_url":"https://api.github.com/repos/cyverse/DE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyverse/DE/downloads","issues_url":"https://api.github.com/repos/cyverse/DE/issues{/number}","pulls_url":"https://api.github.com/repos/cyverse/DE/pulls{/number}","milestones_url":"https://api.github.com/repos/cyverse/DE/milestones{/number}","notifications_url":"https://api.github.com/repos/cyverse/DE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyverse/DE/labels{/name}","releases_url":"https://api.github.com/repos/cyverse/DE/releases{/id}","deployments_url":"https://api.github.com/repos/cyverse/DE/deployments","created_at":"2015-11-03T01:27:41Z","updated_at":"2016-03-05T02:16:59Z","pushed_at":"2016-06-15T17:37:36Z","git_url":"git://github.com/cyverse/DE.git","ssh_url":"git@github.com:cyverse/DE.git","clone_url":"https://github.com/cyverse/DE.git","svn_url":"https://github.com/cyverse/DE","homepage":"https://de.iplantcollaborative.org/de/","size":42365,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cyverse/DE/pulls/218"},"html":{"href":"https://github.com/cyverse/DE/pull/218"},"issue":{"href":"https://api.github.com/repos/cyverse/DE/issues/218"},"comments":{"href":"https://api.github.com/repos/cyverse/DE/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/cyverse/DE/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/cyverse/DE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cyverse/DE/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/cyverse/DE/statuses/2b4c2722e7979c998426deb2197ce387cb1cdcf7"}}}}
{"actor":{"display_login":"dennisroberts71"}}