{"action":"created","comment":{"url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/comments/50187151","id":50187151,"diff_hunk":"@@ -148,9 +148,16 @@ def event_new_or_edit(request, edit=None):\n         form = AddEventForm(request.POST)\n         if form.is_valid():\n             fd = form.cleaned_data\n-            if not superuser and not request.user.is_related_with(\n-                    fd['owner']) and not fd['owner'] == request.user.id:\n-                raise PermissionDenied\n+            # The superuser may do everything, and when you yourself are the\n+            # owner that's always okay too.\n+            if not superuser and fd['owner'] != request.user.id:\n+                # Check some more constraints.\n+                owner = Es.by_id(fd['owner'])\n+                if not request.user.is_related_with(owner):","path":"kn/subscriptions/views.py","position":12,"original_position":12,"commit_id":"fcf604b69e11c7cbebd91d9ba7a730af8181b70c","original_commit_id":"fcf604b69e11c7cbebd91d9ba7a730af8181b70c","user":{"login":"bwesterb","id":9975,"avatar_url":"https://avatars.githubusercontent.com/u/9975?v=3","gravatar_id":"","url":"https://api.github.com/users/bwesterb","html_url":"https://github.com/bwesterb","followers_url":"https://api.github.com/users/bwesterb/followers","following_url":"https://api.github.com/users/bwesterb/following{/other_user}","gists_url":"https://api.github.com/users/bwesterb/gists{/gist_id}","starred_url":"https://api.github.com/users/bwesterb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwesterb/subscriptions","organizations_url":"https://api.github.com/users/bwesterb/orgs","repos_url":"https://api.github.com/users/bwesterb/repos","events_url":"https://api.github.com/users/bwesterb/events{/privacy}","received_events_url":"https://api.github.com/users/bwesterb/received_events","type":"User","site_admin":false},"body":"In de tussentijd is dit prima en zal ik het mergen.","created_at":"2016-01-19T22:34:34Z","updated_at":"2016-01-19T22:34:34Z","html_url":"https://github.com/karpenoktem/kninfra/pull/347#discussion_r50187151","pull_request_url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347","_links":{"self":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/comments/50187151"},"html":{"href":"https://github.com/karpenoktem/kninfra/pull/347#discussion_r50187151"},"pull_request":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347"}}},"pull_request":{"url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347","id":56526229,"html_url":"https://github.com/karpenoktem/kninfra/pull/347","diff_url":"https://github.com/karpenoktem/kninfra/pull/347.diff","patch_url":"https://github.com/karpenoktem/kninfra/pull/347.patch","issue_url":"https://api.github.com/repos/karpenoktem/kninfra/issues/347","number":347,"state":"open","locked":false,"title":"Vereis dat de 'owner' een commissie is","user":{"login":"aykevl","id":729697,"avatar_url":"https://avatars.githubusercontent.com/u/729697?v=3","gravatar_id":"","url":"https://api.github.com/users/aykevl","html_url":"https://github.com/aykevl","followers_url":"https://api.github.com/users/aykevl/followers","following_url":"https://api.github.com/users/aykevl/following{/other_user}","gists_url":"https://api.github.com/users/aykevl/gists{/gist_id}","starred_url":"https://api.github.com/users/aykevl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aykevl/subscriptions","organizations_url":"https://api.github.com/users/aykevl/orgs","repos_url":"https://api.github.com/users/aykevl/repos","events_url":"https://api.github.com/users/aykevl/events{/privacy}","received_events_url":"https://api.github.com/users/aykevl/received_events","type":"User","site_admin":false},"body":"Dit lijkt me wel belangrijk. Op dit moment kun je een activiteit met de 'Uit' als owner maken, dat lijkt me niet de bedoeling.","created_at":"2016-01-19T21:12:41Z","updated_at":"2016-01-19T22:34:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a0f054bb09e907e0ffbe597ba031521184532fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347/commits","review_comments_url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347/comments","review_comment_url":"https://api.github.com/repos/karpenoktem/kninfra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/karpenoktem/kninfra/issues/347/comments","statuses_url":"https://api.github.com/repos/karpenoktem/kninfra/statuses/fcf604b69e11c7cbebd91d9ba7a730af8181b70c","head":{"label":"aykevl:events-owner-permission","ref":"events-owner-permission","sha":"fcf604b69e11c7cbebd91d9ba7a730af8181b70c","user":{"login":"aykevl","id":729697,"avatar_url":"https://avatars.githubusercontent.com/u/729697?v=3","gravatar_id":"","url":"https://api.github.com/users/aykevl","html_url":"https://github.com/aykevl","followers_url":"https://api.github.com/users/aykevl/followers","following_url":"https://api.github.com/users/aykevl/following{/other_user}","gists_url":"https://api.github.com/users/aykevl/gists{/gist_id}","starred_url":"https://api.github.com/users/aykevl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aykevl/subscriptions","organizations_url":"https://api.github.com/users/aykevl/orgs","repos_url":"https://api.github.com/users/aykevl/repos","events_url":"https://api.github.com/users/aykevl/events{/privacy}","received_events_url":"https://api.github.com/users/aykevl/received_events","type":"User","site_admin":false},"repo":{"id":7627453,"name":"kninfra","full_name":"aykevl/kninfra","owner":{"login":"aykevl","id":729697,"avatar_url":"https://avatars.githubusercontent.com/u/729697?v=3","gravatar_id":"","url":"https://api.github.com/users/aykevl","html_url":"https://github.com/aykevl","followers_url":"https://api.github.com/users/aykevl/followers","following_url":"https://api.github.com/users/aykevl/following{/other_user}","gists_url":"https://api.github.com/users/aykevl/gists{/gist_id}","starred_url":"https://api.github.com/users/aykevl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aykevl/subscriptions","organizations_url":"https://api.github.com/users/aykevl/orgs","repos_url":"https://api.github.com/users/aykevl/repos","events_url":"https://api.github.com/users/aykevl/events{/privacy}","received_events_url":"https://api.github.com/users/aykevl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aykevl/kninfra","description":"Digital infrastructure of Karpe Noktem","fork":true,"url":"https://api.github.com/repos/aykevl/kninfra","forks_url":"https://api.github.com/repos/aykevl/kninfra/forks","keys_url":"https://api.github.com/repos/aykevl/kninfra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aykevl/kninfra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aykevl/kninfra/teams","hooks_url":"https://api.github.com/repos/aykevl/kninfra/hooks","issue_events_url":"https://api.github.com/repos/aykevl/kninfra/issues/events{/number}","events_url":"https://api.github.com/repos/aykevl/kninfra/events","assignees_url":"https://api.github.com/repos/aykevl/kninfra/assignees{/user}","branches_url":"https://api.github.com/repos/aykevl/kninfra/branches{/branch}","tags_url":"https://api.github.com/repos/aykevl/kninfra/tags","blobs_url":"https://api.github.com/repos/aykevl/kninfra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aykevl/kninfra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aykevl/kninfra/git/refs{/sha}","trees_url":"https://api.github.com/repos/aykevl/kninfra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aykevl/kninfra/statuses/{sha}","languages_url":"https://api.github.com/repos/aykevl/kninfra/languages","stargazers_url":"https://api.github.com/repos/aykevl/kninfra/stargazers","contributors_url":"https://api.github.com/repos/aykevl/kninfra/contributors","subscribers_url":"https://api.github.com/repos/aykevl/kninfra/subscribers","subscription_url":"https://api.github.com/repos/aykevl/kninfra/subscription","commits_url":"https://api.github.com/repos/aykevl/kninfra/commits{/sha}","git_commits_url":"https://api.github.com/repos/aykevl/kninfra/git/commits{/sha}","comments_url":"https://api.github.com/repos/aykevl/kninfra/comments{/number}","issue_comment_url":"https://api.github.com/repos/aykevl/kninfra/issues/comments{/number}","contents_url":"https://api.github.com/repos/aykevl/kninfra/contents/{+path}","compare_url":"https://api.github.com/repos/aykevl/kninfra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aykevl/kninfra/merges","archive_url":"https://api.github.com/repos/aykevl/kninfra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aykevl/kninfra/downloads","issues_url":"https://api.github.com/repos/aykevl/kninfra/issues{/number}","pulls_url":"https://api.github.com/repos/aykevl/kninfra/pulls{/number}","milestones_url":"https://api.github.com/repos/aykevl/kninfra/milestones{/number}","notifications_url":"https://api.github.com/repos/aykevl/kninfra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aykevl/kninfra/labels{/name}","releases_url":"https://api.github.com/repos/aykevl/kninfra/releases{/id}","created_at":"2013-01-15T15:32:10Z","updated_at":"2015-04-24T17:48:01Z","pushed_at":"2016-01-19T21:47:14Z","git_url":"git://github.com/aykevl/kninfra.git","ssh_url":"git@github.com:aykevl/kninfra.git","clone_url":"https://github.com/aykevl/kninfra.git","svn_url":"https://github.com/aykevl/kninfra","homepage":"http://karpenoktem.nl/","size":29906,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"karpenoktem:master","ref":"master","sha":"8333aceb0a63b44cb2b20ebed3a1fddd780464a1","user":{"login":"karpenoktem","id":460625,"avatar_url":"https://avatars.githubusercontent.com/u/460625?v=3","gravatar_id":"","url":"https://api.github.com/users/karpenoktem","html_url":"https://github.com/karpenoktem","followers_url":"https://api.github.com/users/karpenoktem/followers","following_url":"https://api.github.com/users/karpenoktem/following{/other_user}","gists_url":"https://api.github.com/users/karpenoktem/gists{/gist_id}","starred_url":"https://api.github.com/users/karpenoktem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karpenoktem/subscriptions","organizations_url":"https://api.github.com/users/karpenoktem/orgs","repos_url":"https://api.github.com/users/karpenoktem/repos","events_url":"https://api.github.com/users/karpenoktem/events{/privacy}","received_events_url":"https://api.github.com/users/karpenoktem/received_events","type":"Organization","site_admin":false},"repo":{"id":1037232,"name":"kninfra","full_name":"karpenoktem/kninfra","owner":{"login":"karpenoktem","id":460625,"avatar_url":"https://avatars.githubusercontent.com/u/460625?v=3","gravatar_id":"","url":"https://api.github.com/users/karpenoktem","html_url":"https://github.com/karpenoktem","followers_url":"https://api.github.com/users/karpenoktem/followers","following_url":"https://api.github.com/users/karpenoktem/following{/other_user}","gists_url":"https://api.github.com/users/karpenoktem/gists{/gist_id}","starred_url":"https://api.github.com/users/karpenoktem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karpenoktem/subscriptions","organizations_url":"https://api.github.com/users/karpenoktem/orgs","repos_url":"https://api.github.com/users/karpenoktem/repos","events_url":"https://api.github.com/users/karpenoktem/events{/privacy}","received_events_url":"https://api.github.com/users/karpenoktem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/karpenoktem/kninfra","description":"Digital infrastructure of Karpe Noktem","fork":false,"url":"https://api.github.com/repos/karpenoktem/kninfra","forks_url":"https://api.github.com/repos/karpenoktem/kninfra/forks","keys_url":"https://api.github.com/repos/karpenoktem/kninfra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karpenoktem/kninfra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karpenoktem/kninfra/teams","hooks_url":"https://api.github.com/repos/karpenoktem/kninfra/hooks","issue_events_url":"https://api.github.com/repos/karpenoktem/kninfra/issues/events{/number}","events_url":"https://api.github.com/repos/karpenoktem/kninfra/events","assignees_url":"https://api.github.com/repos/karpenoktem/kninfra/assignees{/user}","branches_url":"https://api.github.com/repos/karpenoktem/kninfra/branches{/branch}","tags_url":"https://api.github.com/repos/karpenoktem/kninfra/tags","blobs_url":"https://api.github.com/repos/karpenoktem/kninfra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karpenoktem/kninfra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karpenoktem/kninfra/git/refs{/sha}","trees_url":"https://api.github.com/repos/karpenoktem/kninfra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karpenoktem/kninfra/statuses/{sha}","languages_url":"https://api.github.com/repos/karpenoktem/kninfra/languages","stargazers_url":"https://api.github.com/repos/karpenoktem/kninfra/stargazers","contributors_url":"https://api.github.com/repos/karpenoktem/kninfra/contributors","subscribers_url":"https://api.github.com/repos/karpenoktem/kninfra/subscribers","subscription_url":"https://api.github.com/repos/karpenoktem/kninfra/subscription","commits_url":"https://api.github.com/repos/karpenoktem/kninfra/commits{/sha}","git_commits_url":"https://api.github.com/repos/karpenoktem/kninfra/git/commits{/sha}","comments_url":"https://api.github.com/repos/karpenoktem/kninfra/comments{/number}","issue_comment_url":"https://api.github.com/repos/karpenoktem/kninfra/issues/comments{/number}","contents_url":"https://api.github.com/repos/karpenoktem/kninfra/contents/{+path}","compare_url":"https://api.github.com/repos/karpenoktem/kninfra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karpenoktem/kninfra/merges","archive_url":"https://api.github.com/repos/karpenoktem/kninfra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karpenoktem/kninfra/downloads","issues_url":"https://api.github.com/repos/karpenoktem/kninfra/issues{/number}","pulls_url":"https://api.github.com/repos/karpenoktem/kninfra/pulls{/number}","milestones_url":"https://api.github.com/repos/karpenoktem/kninfra/milestones{/number}","notifications_url":"https://api.github.com/repos/karpenoktem/kninfra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karpenoktem/kninfra/labels{/name}","releases_url":"https://api.github.com/repos/karpenoktem/kninfra/releases{/id}","created_at":"2010-10-30T11:19:48Z","updated_at":"2015-11-07T15:30:10Z","pushed_at":"2016-01-19T22:29:51Z","git_url":"git://github.com/karpenoktem/kninfra.git","ssh_url":"git@github.com:karpenoktem/kninfra.git","clone_url":"https://github.com/karpenoktem/kninfra.git","svn_url":"https://github.com/karpenoktem/kninfra","homepage":"http://karpenoktem.nl/","size":30735,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":51,"forks":10,"open_issues":51,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347"},"html":{"href":"https://github.com/karpenoktem/kninfra/pull/347"},"issue":{"href":"https://api.github.com/repos/karpenoktem/kninfra/issues/347"},"comments":{"href":"https://api.github.com/repos/karpenoktem/kninfra/issues/347/comments"},"review_comments":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347/comments"},"review_comment":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/karpenoktem/kninfra/pulls/347/commits"},"statuses":{"href":"https://api.github.com/repos/karpenoktem/kninfra/statuses/fcf604b69e11c7cbebd91d9ba7a730af8181b70c"}}}}