{"action":"created","comment":{"url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/comments/57567754","id":57567754,"diff_hunk":"@@ -0,0 +1,82 @@\n+#!/usr/bin/env python\n+#-*- coding:utf-8 -*-\n+\n+import unittest\n+\n+import rbac.acl\n+import rbac.context\n+\n+\n+class _FunctionProxy(object):\n+        def __init__(self, fn, evaluated_roles, role_idx=0):","path":"tests/test_ordering.py","position":null,"original_position":11,"commit_id":"31de0db50c927125a20f36434e827c71197e342f","original_commit_id":"6cedb0d4b1e969296c635543b87fe32e7eb2b3c0","user":{"login":"dbaneman","id":1410872,"avatar_url":"https://avatars.githubusercontent.com/u/1410872?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaneman","html_url":"https://github.com/dbaneman","followers_url":"https://api.github.com/users/dbaneman/followers","following_url":"https://api.github.com/users/dbaneman/following{/other_user}","gists_url":"https://api.github.com/users/dbaneman/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaneman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaneman/subscriptions","organizations_url":"https://api.github.com/users/dbaneman/orgs","repos_url":"https://api.github.com/users/dbaneman/repos","events_url":"https://api.github.com/users/dbaneman/events{/privacy}","received_events_url":"https://api.github.com/users/dbaneman/received_events","type":"User","site_admin":false},"body":"Good catch -- fixed!","created_at":"2016-03-28T12:42:17Z","updated_at":"2016-03-28T12:42:17Z","html_url":"https://github.com/tonyseek/simple-rbac/pull/5#discussion_r57567754","pull_request_url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/comments/57567754"},"html":{"href":"https://github.com/tonyseek/simple-rbac/pull/5#discussion_r57567754"},"pull_request":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5","id":64271460,"html_url":"https://github.com/tonyseek/simple-rbac/pull/5","diff_url":"https://github.com/tonyseek/simple-rbac/pull/5.diff","patch_url":"https://github.com/tonyseek/simple-rbac/pull/5.patch","issue_url":"https://api.github.com/repos/tonyseek/simple-rbac/issues/5","number":5,"state":"open","locked":false,"title":"Preserve role evaluation order and add short circuiting","user":{"login":"dbaneman","id":1410872,"avatar_url":"https://avatars.githubusercontent.com/u/1410872?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaneman","html_url":"https://github.com/dbaneman","followers_url":"https://api.github.com/users/dbaneman/followers","following_url":"https://api.github.com/users/dbaneman/following{/other_user}","gists_url":"https://api.github.com/users/dbaneman/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaneman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaneman/subscriptions","organizations_url":"https://api.github.com/users/dbaneman/orgs","repos_url":"https://api.github.com/users/dbaneman/repos","events_url":"https://api.github.com/users/dbaneman/events{/privacy}","received_events_url":"https://api.github.com/users/dbaneman/received_events","type":"User","site_admin":false},"body":"This branch has a few miscellaneous changes that I needed for a project I was working on, in which the optional assertion function was potentially expensive:\r\n- Preserve evaluation order from the role loader function. If some roles are cheaper to evaluate than others (e.g. because they have a less expensive assertion function), evaluate them first.\r\n- Add short-circuiting during role evaluation. Once a permission is definitely allowed or denied, don't bother evaluating additional roles.\r\n- Allow arbitrary kwargs in the optional assertion, which allows for more flexible assertion functions.","created_at":"2016-03-27T18:02:27Z","updated_at":"2016-03-28T12:42:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68943cae3da9dee9daad81f3b0d17a7b8b53e94f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5/commits","review_comments_url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5/comments","review_comment_url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tonyseek/simple-rbac/issues/5/comments","statuses_url":"https://api.github.com/repos/tonyseek/simple-rbac/statuses/31de0db50c927125a20f36434e827c71197e342f","head":{"label":"dbaneman:preserve-role-evaluation-order-and-add-short-circuiting","ref":"preserve-role-evaluation-order-and-add-short-circuiting","sha":"31de0db50c927125a20f36434e827c71197e342f","user":{"login":"dbaneman","id":1410872,"avatar_url":"https://avatars.githubusercontent.com/u/1410872?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaneman","html_url":"https://github.com/dbaneman","followers_url":"https://api.github.com/users/dbaneman/followers","following_url":"https://api.github.com/users/dbaneman/following{/other_user}","gists_url":"https://api.github.com/users/dbaneman/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaneman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaneman/subscriptions","organizations_url":"https://api.github.com/users/dbaneman/orgs","repos_url":"https://api.github.com/users/dbaneman/repos","events_url":"https://api.github.com/users/dbaneman/events{/privacy}","received_events_url":"https://api.github.com/users/dbaneman/received_events","type":"User","site_admin":false},"repo":{"id":37423863,"name":"simple-rbac","full_name":"dbaneman/simple-rbac","owner":{"login":"dbaneman","id":1410872,"avatar_url":"https://avatars.githubusercontent.com/u/1410872?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaneman","html_url":"https://github.com/dbaneman","followers_url":"https://api.github.com/users/dbaneman/followers","following_url":"https://api.github.com/users/dbaneman/following{/other_user}","gists_url":"https://api.github.com/users/dbaneman/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaneman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaneman/subscriptions","organizations_url":"https://api.github.com/users/dbaneman/orgs","repos_url":"https://api.github.com/users/dbaneman/repos","events_url":"https://api.github.com/users/dbaneman/events{/privacy}","received_events_url":"https://api.github.com/users/dbaneman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dbaneman/simple-rbac","description":"A simple role based access control utility for Python.","fork":true,"url":"https://api.github.com/repos/dbaneman/simple-rbac","forks_url":"https://api.github.com/repos/dbaneman/simple-rbac/forks","keys_url":"https://api.github.com/repos/dbaneman/simple-rbac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dbaneman/simple-rbac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dbaneman/simple-rbac/teams","hooks_url":"https://api.github.com/repos/dbaneman/simple-rbac/hooks","issue_events_url":"https://api.github.com/repos/dbaneman/simple-rbac/issues/events{/number}","events_url":"https://api.github.com/repos/dbaneman/simple-rbac/events","assignees_url":"https://api.github.com/repos/dbaneman/simple-rbac/assignees{/user}","branches_url":"https://api.github.com/repos/dbaneman/simple-rbac/branches{/branch}","tags_url":"https://api.github.com/repos/dbaneman/simple-rbac/tags","blobs_url":"https://api.github.com/repos/dbaneman/simple-rbac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dbaneman/simple-rbac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dbaneman/simple-rbac/git/refs{/sha}","trees_url":"https://api.github.com/repos/dbaneman/simple-rbac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dbaneman/simple-rbac/statuses/{sha}","languages_url":"https://api.github.com/repos/dbaneman/simple-rbac/languages","stargazers_url":"https://api.github.com/repos/dbaneman/simple-rbac/stargazers","contributors_url":"https://api.github.com/repos/dbaneman/simple-rbac/contributors","subscribers_url":"https://api.github.com/repos/dbaneman/simple-rbac/subscribers","subscription_url":"https://api.github.com/repos/dbaneman/simple-rbac/subscription","commits_url":"https://api.github.com/repos/dbaneman/simple-rbac/commits{/sha}","git_commits_url":"https://api.github.com/repos/dbaneman/simple-rbac/git/commits{/sha}","comments_url":"https://api.github.com/repos/dbaneman/simple-rbac/comments{/number}","issue_comment_url":"https://api.github.com/repos/dbaneman/simple-rbac/issues/comments{/number}","contents_url":"https://api.github.com/repos/dbaneman/simple-rbac/contents/{+path}","compare_url":"https://api.github.com/repos/dbaneman/simple-rbac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dbaneman/simple-rbac/merges","archive_url":"https://api.github.com/repos/dbaneman/simple-rbac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dbaneman/simple-rbac/downloads","issues_url":"https://api.github.com/repos/dbaneman/simple-rbac/issues{/number}","pulls_url":"https://api.github.com/repos/dbaneman/simple-rbac/pulls{/number}","milestones_url":"https://api.github.com/repos/dbaneman/simple-rbac/milestones{/number}","notifications_url":"https://api.github.com/repos/dbaneman/simple-rbac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dbaneman/simple-rbac/labels{/name}","releases_url":"https://api.github.com/repos/dbaneman/simple-rbac/releases{/id}","deployments_url":"https://api.github.com/repos/dbaneman/simple-rbac/deployments","created_at":"2015-06-14T18:19:08Z","updated_at":"2015-11-29T14:52:21Z","pushed_at":"2016-03-28T12:41:00Z","git_url":"git://github.com/dbaneman/simple-rbac.git","ssh_url":"git@github.com:dbaneman/simple-rbac.git","clone_url":"https://github.com/dbaneman/simple-rbac.git","svn_url":"https://github.com/dbaneman/simple-rbac","homepage":"","size":46,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"tonyseek:master","ref":"master","sha":"c93f5d294b49422b481fbce45ccc0ce1c3ac42e8","user":{"login":"tonyseek","id":624598,"avatar_url":"https://avatars.githubusercontent.com/u/624598?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyseek","html_url":"https://github.com/tonyseek","followers_url":"https://api.github.com/users/tonyseek/followers","following_url":"https://api.github.com/users/tonyseek/following{/other_user}","gists_url":"https://api.github.com/users/tonyseek/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyseek/subscriptions","organizations_url":"https://api.github.com/users/tonyseek/orgs","repos_url":"https://api.github.com/users/tonyseek/repos","events_url":"https://api.github.com/users/tonyseek/events{/privacy}","received_events_url":"https://api.github.com/users/tonyseek/received_events","type":"User","site_admin":false},"repo":{"id":4268402,"name":"simple-rbac","full_name":"tonyseek/simple-rbac","owner":{"login":"tonyseek","id":624598,"avatar_url":"https://avatars.githubusercontent.com/u/624598?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyseek","html_url":"https://github.com/tonyseek","followers_url":"https://api.github.com/users/tonyseek/followers","following_url":"https://api.github.com/users/tonyseek/following{/other_user}","gists_url":"https://api.github.com/users/tonyseek/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyseek/subscriptions","organizations_url":"https://api.github.com/users/tonyseek/orgs","repos_url":"https://api.github.com/users/tonyseek/repos","events_url":"https://api.github.com/users/tonyseek/events{/privacy}","received_events_url":"https://api.github.com/users/tonyseek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonyseek/simple-rbac","description":"A simple role based access control utility for Python.","fork":false,"url":"https://api.github.com/repos/tonyseek/simple-rbac","forks_url":"https://api.github.com/repos/tonyseek/simple-rbac/forks","keys_url":"https://api.github.com/repos/tonyseek/simple-rbac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonyseek/simple-rbac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonyseek/simple-rbac/teams","hooks_url":"https://api.github.com/repos/tonyseek/simple-rbac/hooks","issue_events_url":"https://api.github.com/repos/tonyseek/simple-rbac/issues/events{/number}","events_url":"https://api.github.com/repos/tonyseek/simple-rbac/events","assignees_url":"https://api.github.com/repos/tonyseek/simple-rbac/assignees{/user}","branches_url":"https://api.github.com/repos/tonyseek/simple-rbac/branches{/branch}","tags_url":"https://api.github.com/repos/tonyseek/simple-rbac/tags","blobs_url":"https://api.github.com/repos/tonyseek/simple-rbac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonyseek/simple-rbac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonyseek/simple-rbac/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonyseek/simple-rbac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonyseek/simple-rbac/statuses/{sha}","languages_url":"https://api.github.com/repos/tonyseek/simple-rbac/languages","stargazers_url":"https://api.github.com/repos/tonyseek/simple-rbac/stargazers","contributors_url":"https://api.github.com/repos/tonyseek/simple-rbac/contributors","subscribers_url":"https://api.github.com/repos/tonyseek/simple-rbac/subscribers","subscription_url":"https://api.github.com/repos/tonyseek/simple-rbac/subscription","commits_url":"https://api.github.com/repos/tonyseek/simple-rbac/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonyseek/simple-rbac/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonyseek/simple-rbac/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonyseek/simple-rbac/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonyseek/simple-rbac/contents/{+path}","compare_url":"https://api.github.com/repos/tonyseek/simple-rbac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonyseek/simple-rbac/merges","archive_url":"https://api.github.com/repos/tonyseek/simple-rbac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonyseek/simple-rbac/downloads","issues_url":"https://api.github.com/repos/tonyseek/simple-rbac/issues{/number}","pulls_url":"https://api.github.com/repos/tonyseek/simple-rbac/pulls{/number}","milestones_url":"https://api.github.com/repos/tonyseek/simple-rbac/milestones{/number}","notifications_url":"https://api.github.com/repos/tonyseek/simple-rbac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonyseek/simple-rbac/labels{/name}","releases_url":"https://api.github.com/repos/tonyseek/simple-rbac/releases{/id}","deployments_url":"https://api.github.com/repos/tonyseek/simple-rbac/deployments","created_at":"2012-05-09T04:38:53Z","updated_at":"2016-03-16T02:23:22Z","pushed_at":"2016-03-28T12:41:00Z","git_url":"git://github.com/tonyseek/simple-rbac.git","ssh_url":"git@github.com:tonyseek/simple-rbac.git","clone_url":"https://github.com/tonyseek/simple-rbac.git","svn_url":"https://github.com/tonyseek/simple-rbac","homepage":"","size":159,"stargazers_count":113,"watchers_count":113,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":28,"mirror_url":null,"open_issues_count":3,"forks":28,"open_issues":3,"watchers":113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5"},"html":{"href":"https://github.com/tonyseek/simple-rbac/pull/5"},"issue":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/issues/5"},"comments":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/tonyseek/simple-rbac/statuses/31de0db50c927125a20f36434e827c71197e342f"}}}}