{"action":"created","comment":{"url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/comments/31202710","id":31202710,"diff_hunk":"@@ -0,0 +1,22 @@\n+# This script walks through each org in a Cloud Foundry instance setting\n+# OrgAuditor and SpaceAuditor permissions at each level.\n+#\n+# Usage:\n+# \n+#  set-quota-auditor.sh AUDIT_USER\n+USER_EMAIL=$1\n+\n+# Strip the host portion of the email supplied.\n+USER_NAME=\"${USER_EMAIL%%@*}\"\n+\n+cf orgs \\\n+  | awk 'm;/^name/{m=1}' \\\n+  | while read ORG_NAME\n+      do cf set-org-role $USER_NAME $ORG_NAME OrgAuditor\n+      cf target -o $ORG_NAME\n+      cf spaces \\\n+      | awk 'm;/^name/{m=1}' \\\n+      | while read SPACE_NAME\n+          do cf set-space-role $USER_NAME $ORG_NAME $SPACE_NAME SpaceAuditor","path":"set-quota-auditor.sh","position":20,"original_position":20,"commit_id":"e6307e3e25d2269e0349d79f829c508571d67228","original_commit_id":"e6307e3e25d2269e0349d79f829c508571d67228","user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"body":"Is this necessary? My understanding is that being an `OrgAuditor` cascades the permissions for the spaces beneath it.","created_at":"2015-05-28T04:35:42Z","updated_at":"2015-05-28T04:35:42Z","html_url":"https://github.com/18F/cloud-foundry-scripts/pull/6#discussion_r31202710","pull_request_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/comments/31202710"},"html":{"href":"https://github.com/18F/cloud-foundry-scripts/pull/6#discussion_r31202710"},"pull_request":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6","id":36346569,"html_url":"https://github.com/18F/cloud-foundry-scripts/pull/6","diff_url":"https://github.com/18F/cloud-foundry-scripts/pull/6.diff","patch_url":"https://github.com/18F/cloud-foundry-scripts/pull/6.patch","issue_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/6","number":6,"state":"open","locked":false,"title":"Set auditor","user":{"login":"ozzyjohnson","id":3709182,"avatar_url":"https://avatars.githubusercontent.com/u/3709182?v=3","gravatar_id":"","url":"https://api.github.com/users/ozzyjohnson","html_url":"https://github.com/ozzyjohnson","followers_url":"https://api.github.com/users/ozzyjohnson/followers","following_url":"https://api.github.com/users/ozzyjohnson/following{/other_user}","gists_url":"https://api.github.com/users/ozzyjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/ozzyjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozzyjohnson/subscriptions","organizations_url":"https://api.github.com/users/ozzyjohnson/orgs","repos_url":"https://api.github.com/users/ozzyjohnson/repos","events_url":"https://api.github.com/users/ozzyjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/ozzyjohnson/received_events","type":"User","site_admin":false},"body":"Quick scripts to walk through the CF instance set auditing perms.","created_at":"2015-05-27T20:44:12Z","updated_at":"2015-05-28T04:35:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3aa5e59e38028c365da78e45bbd7c0ce8a68fc9b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6/commits","review_comments_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6/comments","review_comment_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/6/comments","statuses_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/statuses/e6307e3e25d2269e0349d79f829c508571d67228","head":{"label":"18F:set-auditor","ref":"set-auditor","sha":"e6307e3e25d2269e0349d79f829c508571d67228","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":32479807,"name":"cloud-foundry-scripts","full_name":"18F/cloud-foundry-scripts","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/cloud-foundry-scripts","description":"Scripts to assist with the configuration and operation of Cloud Foundry.","fork":false,"url":"https://api.github.com/repos/18F/cloud-foundry-scripts","forks_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/forks","keys_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/teams","hooks_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/hooks","issue_events_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/events","assignees_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/tags","blobs_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/languages","stargazers_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/stargazers","contributors_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/contributors","subscribers_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/subscribers","subscription_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/subscription","commits_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/merges","archive_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/downloads","issues_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/labels{/name}","releases_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/releases{/id}","created_at":"2015-03-18T19:31:44Z","updated_at":"2015-03-19T21:28:33Z","pushed_at":"2015-05-27T20:44:12Z","git_url":"git://github.com/18F/cloud-foundry-scripts.git","ssh_url":"git@github.com:18F/cloud-foundry-scripts.git","clone_url":"https://github.com/18F/cloud-foundry-scripts.git","svn_url":"https://github.com/18F/cloud-foundry-scripts","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"7cd21c0c264b22661465c2e2d926365600e4e81e","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":32479807,"name":"cloud-foundry-scripts","full_name":"18F/cloud-foundry-scripts","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/cloud-foundry-scripts","description":"Scripts to assist with the configuration and operation of Cloud Foundry.","fork":false,"url":"https://api.github.com/repos/18F/cloud-foundry-scripts","forks_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/forks","keys_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/teams","hooks_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/hooks","issue_events_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/events","assignees_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/tags","blobs_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/languages","stargazers_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/stargazers","contributors_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/contributors","subscribers_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/subscribers","subscription_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/subscription","commits_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/merges","archive_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/downloads","issues_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/labels{/name}","releases_url":"https://api.github.com/repos/18F/cloud-foundry-scripts/releases{/id}","created_at":"2015-03-18T19:31:44Z","updated_at":"2015-03-19T21:28:33Z","pushed_at":"2015-05-27T20:44:12Z","git_url":"git://github.com/18F/cloud-foundry-scripts.git","ssh_url":"git@github.com:18F/cloud-foundry-scripts.git","clone_url":"https://github.com/18F/cloud-foundry-scripts.git","svn_url":"https://github.com/18F/cloud-foundry-scripts","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6"},"html":{"href":"https://github.com/18F/cloud-foundry-scripts/pull/6"},"issue":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/6"},"comments":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/18F/cloud-foundry-scripts/statuses/e6307e3e25d2269e0349d79f829c508571d67228"}}}}