{"action":"created","comment":{"url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments/55466940","id":55466940,"diff_hunk":"@@ -9,3 +9,78 @@\n #\n # We recommend using the bang functions (`insert!`, `update!`\n # and so on) as they will fail if something goes wrong.\n+require Logger\n+\n+alias Yggdrasil.{Repo, Resource, Permission, Role, RolePermission}\n+\n+perms = [\"read\", \"write\", \"all\"]\n+res = [\"character\", \"game\"]\n+\n+Repo.transaction fn ->\n+  Enum.each perms, fn p ->\n+    if Repo.get(Permission, p) == nil do\n+      Repo.insert! %Permission{name: p}\n+    else\n+      Logger.warn fn -> \"found permission #{p} skipping insert\" end","path":"apps/yggdrasil/priv/repo/seeds.exs","position":16,"original_position":16,"commit_id":"9d6d9af7a8f74cfa6cd2ba65785deb69ef071d45","original_commit_id":"9d6d9af7a8f74cfa6cd2ba65785deb69ef071d45","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":"Why a `warn`?","created_at":"2016-03-09T03:07:14Z","updated_at":"2016-03-09T03:07:14Z","html_url":"https://github.com/voluspa/yggdrasil/pull/29#discussion_r55466940","pull_request_url":"https://api.github.com/repos/voluspa/yggdrasil/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/voluspa/yggdrasil/pulls/comments/55466940"},"html":{"href":"https://github.com/voluspa/yggdrasil/pull/29#discussion_r55466940"},"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- [x] tests to ensure plug works\r\n- [x] tests to ensure roles get defaulted","created_at":"2016-03-01T20:12:01Z","updated_at":"2016-03-09T03:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e67ffc6eb2fdfd027059eb8271f9c86777aa7509","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/9d6d9af7a8f74cfa6cd2ba65785deb69ef071d45","head":{"label":"voluspa:char.perms","ref":"char.perms","sha":"9d6d9af7a8f74cfa6cd2ba65785deb69ef071d45","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-08T04:17:36Z","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":4756,"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":8,"forks":1,"open_issues":8,"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-08T04:17:36Z","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":4756,"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":8,"forks":1,"open_issues":8,"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/9d6d9af7a8f74cfa6cd2ba65785deb69ef071d45"}}}}