{"action":"created","comment":{"url":"https://api.github.com/repos/enova/landable/pulls/comments/32244806","id":32244806,"diff_hunk":"@@ -42,6 +48,18 @@ def find_own_access_token(id = params[:id])\n       def asset_token_params\n         params.require(:access_token).permit(:username, :password)\n       end\n+\n+      def determine_permissions(user_groups) # input: [\"HipChat Users\", \"PagerDuty Users\", \"popops\"]\n+        yaml_groups = YAML.load(File.read(Rails.root.join('config', 'ldap.yml')))[:permissions][\"CNU\"]\n+\n+        user_groups.inject([]) do |permissions, group|\n+          permissions << \"read\" if yaml_groups[group][\"read\"]\n+          permissions << \"edit\" if yaml_groups[group][\"edit\"]\n+          permissions << \"publish\" if yaml_groups[group][\"publish\"]","path":"app/controllers/landable/api/access_tokens_controller.rb","position":28,"original_position":28,"commit_id":"2bffc8733fe9977ed30a0ef2e97c61cf0cb4e4b7","original_commit_id":"2bffc8733fe9977ed30a0ef2e97c61cf0cb4e4b7","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2015-06-11T17:18:24Z","updated_at":"2015-06-11T17:18:24Z","html_url":"https://github.com/enova/landable/pull/62#discussion_r32244806","pull_request_url":"https://api.github.com/repos/enova/landable/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/enova/landable/pulls/comments/32244806"},"html":{"href":"https://github.com/enova/landable/pull/62#discussion_r32244806"},"pull_request":{"href":"https://api.github.com/repos/enova/landable/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/enova/landable/pulls/62","id":37059266,"html_url":"https://github.com/enova/landable/pull/62","diff_url":"https://github.com/enova/landable/pull/62.diff","patch_url":"https://github.com/enova/landable/pull/62.patch","issue_url":"https://api.github.com/repos/enova/landable/issues/62","number":62,"state":"open","locked":false,"title":"Add permission attributes to the Authors model.","user":{"login":"paulh16","id":1412714,"avatar_url":"https://avatars.githubusercontent.com/u/1412714?v=3","gravatar_id":"","url":"https://api.github.com/users/paulh16","html_url":"https://github.com/paulh16","followers_url":"https://api.github.com/users/paulh16/followers","following_url":"https://api.github.com/users/paulh16/following{/other_user}","gists_url":"https://api.github.com/users/paulh16/gists{/gist_id}","starred_url":"https://api.github.com/users/paulh16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulh16/subscriptions","organizations_url":"https://api.github.com/users/paulh16/orgs","repos_url":"https://api.github.com/users/paulh16/repos","events_url":"https://api.github.com/users/paulh16/events{/privacy}","received_events_url":"https://api.github.com/users/paulh16/received_events","type":"User","site_admin":false},"body":"**Because:**\r\n\r\nTo handle permissions in Publicist, we need to give the Author model permissions attributes.\r\n\r\n**Pull:**\r\n\r\nAdd a migration that add `read_access`, `edit_access` and `publish_access` to the Author model. It defaults to false if NULL.","created_at":"2015-06-05T18:50:15Z","updated_at":"2015-06-11T17:18:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5e56c9e7ac95a424df2c894f967cf31c422a306","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enova/landable/pulls/62/commits","review_comments_url":"https://api.github.com/repos/enova/landable/pulls/62/comments","review_comment_url":"https://api.github.com/repos/enova/landable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enova/landable/issues/62/comments","statuses_url":"https://api.github.com/repos/enova/landable/statuses/2bffc8733fe9977ed30a0ef2e97c61cf0cb4e4b7","head":{"label":"paulh16:feature/add_permissions_to_author","ref":"feature/add_permissions_to_author","sha":"2bffc8733fe9977ed30a0ef2e97c61cf0cb4e4b7","user":{"login":"paulh16","id":1412714,"avatar_url":"https://avatars.githubusercontent.com/u/1412714?v=3","gravatar_id":"","url":"https://api.github.com/users/paulh16","html_url":"https://github.com/paulh16","followers_url":"https://api.github.com/users/paulh16/followers","following_url":"https://api.github.com/users/paulh16/following{/other_user}","gists_url":"https://api.github.com/users/paulh16/gists{/gist_id}","starred_url":"https://api.github.com/users/paulh16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulh16/subscriptions","organizations_url":"https://api.github.com/users/paulh16/orgs","repos_url":"https://api.github.com/users/paulh16/repos","events_url":"https://api.github.com/users/paulh16/events{/privacy}","received_events_url":"https://api.github.com/users/paulh16/received_events","type":"User","site_admin":false},"repo":{"id":36949425,"name":"landable","full_name":"paulh16/landable","owner":{"login":"paulh16","id":1412714,"avatar_url":"https://avatars.githubusercontent.com/u/1412714?v=3","gravatar_id":"","url":"https://api.github.com/users/paulh16","html_url":"https://github.com/paulh16","followers_url":"https://api.github.com/users/paulh16/followers","following_url":"https://api.github.com/users/paulh16/following{/other_user}","gists_url":"https://api.github.com/users/paulh16/gists{/gist_id}","starred_url":"https://api.github.com/users/paulh16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulh16/subscriptions","organizations_url":"https://api.github.com/users/paulh16/orgs","repos_url":"https://api.github.com/users/paulh16/repos","events_url":"https://api.github.com/users/paulh16/events{/privacy}","received_events_url":"https://api.github.com/users/paulh16/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulh16/landable","description":"an API for your CMS ","fork":true,"url":"https://api.github.com/repos/paulh16/landable","forks_url":"https://api.github.com/repos/paulh16/landable/forks","keys_url":"https://api.github.com/repos/paulh16/landable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulh16/landable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulh16/landable/teams","hooks_url":"https://api.github.com/repos/paulh16/landable/hooks","issue_events_url":"https://api.github.com/repos/paulh16/landable/issues/events{/number}","events_url":"https://api.github.com/repos/paulh16/landable/events","assignees_url":"https://api.github.com/repos/paulh16/landable/assignees{/user}","branches_url":"https://api.github.com/repos/paulh16/landable/branches{/branch}","tags_url":"https://api.github.com/repos/paulh16/landable/tags","blobs_url":"https://api.github.com/repos/paulh16/landable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulh16/landable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulh16/landable/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulh16/landable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulh16/landable/statuses/{sha}","languages_url":"https://api.github.com/repos/paulh16/landable/languages","stargazers_url":"https://api.github.com/repos/paulh16/landable/stargazers","contributors_url":"https://api.github.com/repos/paulh16/landable/contributors","subscribers_url":"https://api.github.com/repos/paulh16/landable/subscribers","subscription_url":"https://api.github.com/repos/paulh16/landable/subscription","commits_url":"https://api.github.com/repos/paulh16/landable/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulh16/landable/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulh16/landable/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulh16/landable/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulh16/landable/contents/{+path}","compare_url":"https://api.github.com/repos/paulh16/landable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulh16/landable/merges","archive_url":"https://api.github.com/repos/paulh16/landable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulh16/landable/downloads","issues_url":"https://api.github.com/repos/paulh16/landable/issues{/number}","pulls_url":"https://api.github.com/repos/paulh16/landable/pulls{/number}","milestones_url":"https://api.github.com/repos/paulh16/landable/milestones{/number}","notifications_url":"https://api.github.com/repos/paulh16/landable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulh16/landable/labels{/name}","releases_url":"https://api.github.com/repos/paulh16/landable/releases{/id}","created_at":"2015-06-05T18:46:31Z","updated_at":"2015-06-05T18:46:32Z","pushed_at":"2015-06-11T17:18:20Z","git_url":"git://github.com/paulh16/landable.git","ssh_url":"git@github.com:paulh16/landable.git","clone_url":"https://github.com/paulh16/landable.git","svn_url":"https://github.com/paulh16/landable","homepage":"","size":2553,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"enova:master","ref":"master","sha":"019167e6978893cb66a46261a286305abf5cb975","user":{"login":"enova","id":220136,"avatar_url":"https://avatars.githubusercontent.com/u/220136?v=3","gravatar_id":"","url":"https://api.github.com/users/enova","html_url":"https://github.com/enova","followers_url":"https://api.github.com/users/enova/followers","following_url":"https://api.github.com/users/enova/following{/other_user}","gists_url":"https://api.github.com/users/enova/gists{/gist_id}","starred_url":"https://api.github.com/users/enova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enova/subscriptions","organizations_url":"https://api.github.com/users/enova/orgs","repos_url":"https://api.github.com/users/enova/repos","events_url":"https://api.github.com/users/enova/events{/privacy}","received_events_url":"https://api.github.com/users/enova/received_events","type":"Organization","site_admin":false},"repo":{"id":19545020,"name":"landable","full_name":"enova/landable","owner":{"login":"enova","id":220136,"avatar_url":"https://avatars.githubusercontent.com/u/220136?v=3","gravatar_id":"","url":"https://api.github.com/users/enova","html_url":"https://github.com/enova","followers_url":"https://api.github.com/users/enova/followers","following_url":"https://api.github.com/users/enova/following{/other_user}","gists_url":"https://api.github.com/users/enova/gists{/gist_id}","starred_url":"https://api.github.com/users/enova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enova/subscriptions","organizations_url":"https://api.github.com/users/enova/orgs","repos_url":"https://api.github.com/users/enova/repos","events_url":"https://api.github.com/users/enova/events{/privacy}","received_events_url":"https://api.github.com/users/enova/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enova/landable","description":"an API for your CMS ","fork":false,"url":"https://api.github.com/repos/enova/landable","forks_url":"https://api.github.com/repos/enova/landable/forks","keys_url":"https://api.github.com/repos/enova/landable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enova/landable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enova/landable/teams","hooks_url":"https://api.github.com/repos/enova/landable/hooks","issue_events_url":"https://api.github.com/repos/enova/landable/issues/events{/number}","events_url":"https://api.github.com/repos/enova/landable/events","assignees_url":"https://api.github.com/repos/enova/landable/assignees{/user}","branches_url":"https://api.github.com/repos/enova/landable/branches{/branch}","tags_url":"https://api.github.com/repos/enova/landable/tags","blobs_url":"https://api.github.com/repos/enova/landable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enova/landable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enova/landable/git/refs{/sha}","trees_url":"https://api.github.com/repos/enova/landable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enova/landable/statuses/{sha}","languages_url":"https://api.github.com/repos/enova/landable/languages","stargazers_url":"https://api.github.com/repos/enova/landable/stargazers","contributors_url":"https://api.github.com/repos/enova/landable/contributors","subscribers_url":"https://api.github.com/repos/enova/landable/subscribers","subscription_url":"https://api.github.com/repos/enova/landable/subscription","commits_url":"https://api.github.com/repos/enova/landable/commits{/sha}","git_commits_url":"https://api.github.com/repos/enova/landable/git/commits{/sha}","comments_url":"https://api.github.com/repos/enova/landable/comments{/number}","issue_comment_url":"https://api.github.com/repos/enova/landable/issues/comments{/number}","contents_url":"https://api.github.com/repos/enova/landable/contents/{+path}","compare_url":"https://api.github.com/repos/enova/landable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enova/landable/merges","archive_url":"https://api.github.com/repos/enova/landable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enova/landable/downloads","issues_url":"https://api.github.com/repos/enova/landable/issues{/number}","pulls_url":"https://api.github.com/repos/enova/landable/pulls{/number}","milestones_url":"https://api.github.com/repos/enova/landable/milestones{/number}","notifications_url":"https://api.github.com/repos/enova/landable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enova/landable/labels{/name}","releases_url":"https://api.github.com/repos/enova/landable/releases{/id}","created_at":"2014-05-07T18:11:57Z","updated_at":"2015-05-05T20:39:59Z","pushed_at":"2015-06-11T17:18:20Z","git_url":"git://github.com/enova/landable.git","ssh_url":"git@github.com:enova/landable.git","clone_url":"https://github.com/enova/landable.git","svn_url":"https://github.com/enova/landable","homepage":"","size":3794,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":7,"forks":14,"open_issues":7,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enova/landable/pulls/62"},"html":{"href":"https://github.com/enova/landable/pull/62"},"issue":{"href":"https://api.github.com/repos/enova/landable/issues/62"},"comments":{"href":"https://api.github.com/repos/enova/landable/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/enova/landable/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/enova/landable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enova/landable/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/enova/landable/statuses/2bffc8733fe9977ed30a0ef2e97c61cf0cb4e4b7"}}}}