{"action":"created","comment":{"url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments/54824406","id":54824406,"diff_hunk":"@@ -0,0 +1,77 @@\n+defmodule YggdrasilWeb.EnsurePermission do\n+  @moduledoc ~S\"\"\"\n+  ## Overview\n+  This plug takes in a connection and set of permission and ensures that all\n+  permissions provided are present for the user on the connection.\n+\n+    import Yggdrasil.EnsurePermission\n+\n+    plug EnsurePermission, [foo: [:read]] when action in [:index]\n+\n+  ## Roles and Permissions \n+  The user's permissions are dictated by their role. Each role has a set\n+  resources and each resource has a set of permissions. With this scheme\n+  the res_perms passed in are in the form of:\n+\n+  [resource: [perm_set], resource: [perm_set]]\n+\n+  for as many resources and permissions that are needed. Then each resource is","path":"apps/yggdrasil_web/lib/yggdrasil_web/ensure_permission.ex","position":18,"original_position":18,"commit_id":"e0a30b35a1a04bf7ffa70b4a3f334f208177a610","original_commit_id":"e0a30b35a1a04bf7ffa70b4a3f334f208177a610","user":{"login":"copenhas","id":357338,"avatar_url":"https://avatars.githubusercontent.com/u/357338?v=3","gravatar_id":"","url":"https://api.github.com/users/copenhas","html_url":"https://github.com/copenhas","followers_url":"https://api.github.com/users/copenhas/followers","following_url":"https://api.github.com/users/copenhas/following{/other_user}","gists_url":"https://api.github.com/users/copenhas/gists{/gist_id}","starred_url":"https://api.github.com/users/copenhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copenhas/subscriptions","organizations_url":"https://api.github.com/users/copenhas/orgs","repos_url":"https://api.github.com/users/copenhas/repos","events_url":"https://api.github.com/users/copenhas/events{/privacy}","received_events_url":"https://api.github.com/users/copenhas/received_events","type":"User","site_admin":false},"body":"A bit awkward breaking up a sentence with an example. Perhaps let the example be the end of the previous sentence and reword this to be more like `You may provide as many resources and permissions that are needed.`","created_at":"2016-03-03T01:38:30Z","updated_at":"2016-03-03T01:38:30Z","html_url":"https://github.com/voluspa/yggdrasil/pull/29#discussion_r54824406","pull_request_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments/54824406"},"html":{"href":"https://github.com/voluspa/yggdrasil/pull/29#discussion_r54824406"},"pull_request":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29","id":61300854,"html_url":"https://github.com/voluspa/yggdrasil/pull/29","diff_url":"https://github.com/voluspa/yggdrasil/pull/29.diff","patch_url":"https://github.com/voluspa/yggdrasil/pull/29.patch","issue_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/29","number":29,"state":"open","locked":false,"title":"Char.perms","user":{"login":"matthewphilyaw","id":709148,"avatar_url":"https://avatars.githubusercontent.com/u/709148?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewphilyaw","html_url":"https://github.com/matthewphilyaw","followers_url":"https://api.github.com/users/matthewphilyaw/followers","following_url":"https://api.github.com/users/matthewphilyaw/following{/other_user}","gists_url":"https://api.github.com/users/matthewphilyaw/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewphilyaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewphilyaw/subscriptions","organizations_url":"https://api.github.com/users/matthewphilyaw/orgs","repos_url":"https://api.github.com/users/matthewphilyaw/repos","events_url":"https://api.github.com/users/matthewphilyaw/events{/privacy}","received_events_url":"https://api.github.com/users/matthewphilyaw/received_events","type":"User","site_admin":false},"body":"Stab at permissions branched off of game.management because it's where it will be used, gives me more to test with.\r\n\r\n- [x] tables to support permissions\r\n- [x] plug to use in controllers\r\n- [x] function to check perms included in the plug\r\n- [ ] tests to ensure plug works\r\n- [ ] tests to ensure roles get defaulted","created_at":"2016-03-01T20:12:01Z","updated_at":"2016-03-03T01:38:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d5a9377be2521d02e753e9b17705f07bfad0b9c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29/commits","review_comments_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29/comments","review_comment_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/29/comments","statuses_url":"https://api.github.com/repos/voluspa/yggdrasil/statuses/e0a30b35a1a04bf7ffa70b4a3f334f208177a610","head":{"label":"voluspa:char.perms","ref":"char.perms","sha":"e0a30b35a1a04bf7ffa70b4a3f334f208177a610","user":{"login":"voluspa","id":6393830,"avatar_url":"https://avatars.githubusercontent.com/u/6393830?v=3","gravatar_id":"","url":"https://api.github.com/users/voluspa","html_url":"https://github.com/voluspa","followers_url":"https://api.github.com/users/voluspa/followers","following_url":"https://api.github.com/users/voluspa/following{/other_user}","gists_url":"https://api.github.com/users/voluspa/gists{/gist_id}","starred_url":"https://api.github.com/users/voluspa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voluspa/subscriptions","organizations_url":"https://api.github.com/users/voluspa/orgs","repos_url":"https://api.github.com/users/voluspa/repos","events_url":"https://api.github.com/users/voluspa/events{/privacy}","received_events_url":"https://api.github.com/users/voluspa/received_events","type":"Organization","site_admin":false},"repo":{"id":48769770,"name":"yggdrasil","full_name":"voluspa/yggdrasil","owner":{"login":"voluspa","id":6393830,"avatar_url":"https://avatars.githubusercontent.com/u/6393830?v=3","gravatar_id":"","url":"https://api.github.com/users/voluspa","html_url":"https://github.com/voluspa","followers_url":"https://api.github.com/users/voluspa/followers","following_url":"https://api.github.com/users/voluspa/following{/other_user}","gists_url":"https://api.github.com/users/voluspa/gists{/gist_id}","starred_url":"https://api.github.com/users/voluspa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voluspa/subscriptions","organizations_url":"https://api.github.com/users/voluspa/orgs","repos_url":"https://api.github.com/users/voluspa/repos","events_url":"https://api.github.com/users/voluspa/events{/privacy}","received_events_url":"https://api.github.com/users/voluspa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/voluspa/yggdrasil","description":"server portion","fork":false,"url":"https://api.github.com/repos/voluspa/yggdrasil","forks_url":"https://api.github.com/repos/voluspa/yggdrasil/forks","keys_url":"https://api.github.com/repos/voluspa/yggdrasil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/voluspa/yggdrasil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/voluspa/yggdrasil/teams","hooks_url":"https://api.github.com/repos/voluspa/yggdrasil/hooks","issue_events_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/events{/number}","events_url":"https://api.github.com/repos/voluspa/yggdrasil/events","assignees_url":"https://api.github.com/repos/voluspa/yggdrasil/assignees{/user}","branches_url":"https://api.github.com/repos/voluspa/yggdrasil/branches{/branch}","tags_url":"https://api.github.com/repos/voluspa/yggdrasil/tags","blobs_url":"https://api.github.com/repos/voluspa/yggdrasil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/voluspa/yggdrasil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/voluspa/yggdrasil/git/refs{/sha}","trees_url":"https://api.github.com/repos/voluspa/yggdrasil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/voluspa/yggdrasil/statuses/{sha}","languages_url":"https://api.github.com/repos/voluspa/yggdrasil/languages","stargazers_url":"https://api.github.com/repos/voluspa/yggdrasil/stargazers","contributors_url":"https://api.github.com/repos/voluspa/yggdrasil/contributors","subscribers_url":"https://api.github.com/repos/voluspa/yggdrasil/subscribers","subscription_url":"https://api.github.com/repos/voluspa/yggdrasil/subscription","commits_url":"https://api.github.com/repos/voluspa/yggdrasil/commits{/sha}","git_commits_url":"https://api.github.com/repos/voluspa/yggdrasil/git/commits{/sha}","comments_url":"https://api.github.com/repos/voluspa/yggdrasil/comments{/number}","issue_comment_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/comments{/number}","contents_url":"https://api.github.com/repos/voluspa/yggdrasil/contents/{+path}","compare_url":"https://api.github.com/repos/voluspa/yggdrasil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/voluspa/yggdrasil/merges","archive_url":"https://api.github.com/repos/voluspa/yggdrasil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/voluspa/yggdrasil/downloads","issues_url":"https://api.github.com/repos/voluspa/yggdrasil/issues{/number}","pulls_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls{/number}","milestones_url":"https://api.github.com/repos/voluspa/yggdrasil/milestones{/number}","notifications_url":"https://api.github.com/repos/voluspa/yggdrasil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/voluspa/yggdrasil/labels{/name}","releases_url":"https://api.github.com/repos/voluspa/yggdrasil/releases{/id}","deployments_url":"https://api.github.com/repos/voluspa/yggdrasil/deployments","created_at":"2015-12-29T22:25:39Z","updated_at":"2016-02-24T01:46:52Z","pushed_at":"2016-03-02T21:25:01Z","git_url":"git://github.com/voluspa/yggdrasil.git","ssh_url":"git@github.com:voluspa/yggdrasil.git","clone_url":"https://github.com/voluspa/yggdrasil.git","svn_url":"https://github.com/voluspa/yggdrasil","homepage":null,"size":4712,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"voluspa:game.management","ref":"game.management","sha":"7ecac4e43c0c49817cb27ac0e019e36738a21291","user":{"login":"voluspa","id":6393830,"avatar_url":"https://avatars.githubusercontent.com/u/6393830?v=3","gravatar_id":"","url":"https://api.github.com/users/voluspa","html_url":"https://github.com/voluspa","followers_url":"https://api.github.com/users/voluspa/followers","following_url":"https://api.github.com/users/voluspa/following{/other_user}","gists_url":"https://api.github.com/users/voluspa/gists{/gist_id}","starred_url":"https://api.github.com/users/voluspa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voluspa/subscriptions","organizations_url":"https://api.github.com/users/voluspa/orgs","repos_url":"https://api.github.com/users/voluspa/repos","events_url":"https://api.github.com/users/voluspa/events{/privacy}","received_events_url":"https://api.github.com/users/voluspa/received_events","type":"Organization","site_admin":false},"repo":{"id":48769770,"name":"yggdrasil","full_name":"voluspa/yggdrasil","owner":{"login":"voluspa","id":6393830,"avatar_url":"https://avatars.githubusercontent.com/u/6393830?v=3","gravatar_id":"","url":"https://api.github.com/users/voluspa","html_url":"https://github.com/voluspa","followers_url":"https://api.github.com/users/voluspa/followers","following_url":"https://api.github.com/users/voluspa/following{/other_user}","gists_url":"https://api.github.com/users/voluspa/gists{/gist_id}","starred_url":"https://api.github.com/users/voluspa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voluspa/subscriptions","organizations_url":"https://api.github.com/users/voluspa/orgs","repos_url":"https://api.github.com/users/voluspa/repos","events_url":"https://api.github.com/users/voluspa/events{/privacy}","received_events_url":"https://api.github.com/users/voluspa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/voluspa/yggdrasil","description":"server portion","fork":false,"url":"https://api.github.com/repos/voluspa/yggdrasil","forks_url":"https://api.github.com/repos/voluspa/yggdrasil/forks","keys_url":"https://api.github.com/repos/voluspa/yggdrasil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/voluspa/yggdrasil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/voluspa/yggdrasil/teams","hooks_url":"https://api.github.com/repos/voluspa/yggdrasil/hooks","issue_events_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/events{/number}","events_url":"https://api.github.com/repos/voluspa/yggdrasil/events","assignees_url":"https://api.github.com/repos/voluspa/yggdrasil/assignees{/user}","branches_url":"https://api.github.com/repos/voluspa/yggdrasil/branches{/branch}","tags_url":"https://api.github.com/repos/voluspa/yggdrasil/tags","blobs_url":"https://api.github.com/repos/voluspa/yggdrasil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/voluspa/yggdrasil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/voluspa/yggdrasil/git/refs{/sha}","trees_url":"https://api.github.com/repos/voluspa/yggdrasil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/voluspa/yggdrasil/statuses/{sha}","languages_url":"https://api.github.com/repos/voluspa/yggdrasil/languages","stargazers_url":"https://api.github.com/repos/voluspa/yggdrasil/stargazers","contributors_url":"https://api.github.com/repos/voluspa/yggdrasil/contributors","subscribers_url":"https://api.github.com/repos/voluspa/yggdrasil/subscribers","subscription_url":"https://api.github.com/repos/voluspa/yggdrasil/subscription","commits_url":"https://api.github.com/repos/voluspa/yggdrasil/commits{/sha}","git_commits_url":"https://api.github.com/repos/voluspa/yggdrasil/git/commits{/sha}","comments_url":"https://api.github.com/repos/voluspa/yggdrasil/comments{/number}","issue_comment_url":"https://api.github.com/repos/voluspa/yggdrasil/issues/comments{/number}","contents_url":"https://api.github.com/repos/voluspa/yggdrasil/contents/{+path}","compare_url":"https://api.github.com/repos/voluspa/yggdrasil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/voluspa/yggdrasil/merges","archive_url":"https://api.github.com/repos/voluspa/yggdrasil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/voluspa/yggdrasil/downloads","issues_url":"https://api.github.com/repos/voluspa/yggdrasil/issues{/number}","pulls_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls{/number}","milestones_url":"https://api.github.com/repos/voluspa/yggdrasil/milestones{/number}","notifications_url":"https://api.github.com/repos/voluspa/yggdrasil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/voluspa/yggdrasil/labels{/name}","releases_url":"https://api.github.com/repos/voluspa/yggdrasil/releases{/id}","deployments_url":"https://api.github.com/repos/voluspa/yggdrasil/deployments","created_at":"2015-12-29T22:25:39Z","updated_at":"2016-02-24T01:46:52Z","pushed_at":"2016-03-02T21:25:01Z","git_url":"git://github.com/voluspa/yggdrasil.git","ssh_url":"git@github.com:voluspa/yggdrasil.git","clone_url":"https://github.com/voluspa/yggdrasil.git","svn_url":"https://github.com/voluspa/yggdrasil","homepage":null,"size":4712,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29"},"html":{"href":"https://github.com/voluspa/yggdrasil/pull/29"},"issue":{"href":"https://api.github.com/repos/voluspa/yggdrasil/issues/29"},"comments":{"href":"https://api.github.com/repos/voluspa/yggdrasil/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/voluspa/yggdrasil/statuses/e0a30b35a1a04bf7ffa70b4a3f334f208177a610"}}}}