{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments/32532356","id":32532356,"diff_hunk":"@@ -100,7 +100,9 @@ def get_record_schema(self, resource, method):\n \n         class RecordPayload(colander.MappingSchema):\n             data = resource.mapping\n-            permissions = PermissionsSchema(missing=colander.drop)\n+            permissions = PermissionsSchema(\n+                missing=colander.drop,\n+                permissions=getattr(resource, 'permissions', tuple()))","path":"cliquet/resource.py","position":7,"original_position":7,"commit_id":"19cb2bad1a0375a582298773b99fee4dea026104","original_commit_id":"19cb2bad1a0375a582298773b99fee4dea026104","user":{"login":"leplatrem","id":546692,"avatar_url":"https://avatars.githubusercontent.com/u/546692?v=3","gravatar_id":"","url":"https://api.github.com/users/leplatrem","html_url":"https://github.com/leplatrem","followers_url":"https://api.github.com/users/leplatrem/followers","following_url":"https://api.github.com/users/leplatrem/following{/other_user}","gists_url":"https://api.github.com/users/leplatrem/gists{/gist_id}","starred_url":"https://api.github.com/users/leplatrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leplatrem/subscriptions","organizations_url":"https://api.github.com/users/leplatrem/orgs","repos_url":"https://api.github.com/users/leplatrem/repos","events_url":"https://api.github.com/users/leplatrem/events{/privacy}","received_events_url":"https://api.github.com/users/leplatrem/received_events","type":"User","site_admin":false},"body":"An intermediary variable would have been nice here ;)\r\n\r\nPlus a small ``XXX`` comment towards issue #322 f","created_at":"2015-06-16T15:22:50Z","updated_at":"2015-06-16T15:22:50Z","html_url":"https://github.com/mozilla-services/cliquet/pull/321#discussion_r32532356","pull_request_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments/32532356"},"html":{"href":"https://github.com/mozilla-services/cliquet/pull/321#discussion_r32532356"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321","id":37805494,"html_url":"https://github.com/mozilla-services/cliquet/pull/321","diff_url":"https://github.com/mozilla-services/cliquet/pull/321.diff","patch_url":"https://github.com/mozilla-services/cliquet/pull/321.patch","issue_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/321","number":321,"state":"open","locked":false,"title":"Raise 400 if specified permission name is invalid","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"Currently the ``PermissionSchema`` is able to raise invalid errors if its ``known_perms`` tuple is set:\r\n\r\n* https://github.com/mozilla-services/cliquet/blob/2.0.dev4/cliquet/tests/test_schema.py#L85-L90\r\n\r\nHowever this tuple is not set when instanciated:\r\n\r\n* https://github.com/mozilla-services/cliquet/blob/2.0.dev4/cliquet/resource.py#L103\r\n\r\nThe list of available permissions for a resource is only used to delete/replace existing permission from the permissio backend:\r\n\r\n* https://github.com/mozilla-services/cliquet/blob/2.0.dev4/cliquet/resource.py#L1038\r\n\r\nWe should plug the two together !","created_at":"2015-06-16T15:08:41Z","updated_at":"2015-06-16T15:22:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0c13ea6709581c1e52b6b710cf78947abe5db53","assignee":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/321/comments","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/19cb2bad1a0375a582298773b99fee4dea026104","head":{"label":"mozilla-services:321_link_resource_permission_with_colander_schemanode","ref":"321_link_resource_permission_with_colander_schemanode","sha":"19cb2bad1a0375a582298773b99fee4dea026104","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":30921526,"name":"cliquet","full_name":"mozilla-services/cliquet","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cliquet","description":"Cloud services API toolkit","fork":false,"url":"https://api.github.com/repos/mozilla-services/cliquet","forks_url":"https://api.github.com/repos/mozilla-services/cliquet/forks","keys_url":"https://api.github.com/repos/mozilla-services/cliquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cliquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cliquet/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cliquet/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cliquet/events","assignees_url":"https://api.github.com/repos/mozilla-services/cliquet/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cliquet/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cliquet/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cliquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cliquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cliquet/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cliquet/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cliquet/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cliquet/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cliquet/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cliquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cliquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/cliquet/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cliquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cliquet/merges","archive_url":"https://api.github.com/repos/mozilla-services/cliquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cliquet/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cliquet/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cliquet/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cliquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cliquet/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cliquet/releases{/id}","created_at":"2015-02-17T14:53:58Z","updated_at":"2015-06-11T21:53:39Z","pushed_at":"2015-06-16T15:20:38Z","git_url":"git://github.com/mozilla-services/cliquet.git","ssh_url":"git@github.com:mozilla-services/cliquet.git","clone_url":"https://github.com/mozilla-services/cliquet.git","svn_url":"https://github.com/mozilla-services/cliquet","homepage":"http://cliquet.readthedocs.org","size":5394,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":45,"forks":6,"open_issues":45,"watchers":8,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"0aae039be5cfbe6e562e53ff80b78219e9cabefc","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":30921526,"name":"cliquet","full_name":"mozilla-services/cliquet","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cliquet","description":"Cloud services API toolkit","fork":false,"url":"https://api.github.com/repos/mozilla-services/cliquet","forks_url":"https://api.github.com/repos/mozilla-services/cliquet/forks","keys_url":"https://api.github.com/repos/mozilla-services/cliquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cliquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cliquet/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cliquet/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cliquet/events","assignees_url":"https://api.github.com/repos/mozilla-services/cliquet/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cliquet/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cliquet/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cliquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cliquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cliquet/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cliquet/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cliquet/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cliquet/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cliquet/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cliquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cliquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/cliquet/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cliquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cliquet/merges","archive_url":"https://api.github.com/repos/mozilla-services/cliquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cliquet/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cliquet/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cliquet/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cliquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cliquet/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cliquet/releases{/id}","created_at":"2015-02-17T14:53:58Z","updated_at":"2015-06-11T21:53:39Z","pushed_at":"2015-06-16T15:20:38Z","git_url":"git://github.com/mozilla-services/cliquet.git","ssh_url":"git@github.com:mozilla-services/cliquet.git","clone_url":"https://github.com/mozilla-services/cliquet.git","svn_url":"https://github.com/mozilla-services/cliquet","homepage":"http://cliquet.readthedocs.org","size":5394,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":45,"forks":6,"open_issues":45,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321"},"html":{"href":"https://github.com/mozilla-services/cliquet/pull/321"},"issue":{"href":"https://api.github.com/repos/mozilla-services/cliquet/issues/321"},"comments":{"href":"https://api.github.com/repos/mozilla-services/cliquet/issues/321/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/321/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/cliquet/statuses/19cb2bad1a0375a582298773b99fee4dea026104"}}}}