{"action":"created","comment":{"url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/comments/47691088","id":47691088,"diff_hunk":"@@ -197,9 +222,54 @@ public function reset(ActivityModel $activity)\n      */\n     public function disapprove(ActivityModel $activity)\n     {\n+        $this->permissionManageActivityOrException();\n+\n         $activity->setStatus(ActivityModel::STATUS_DISAPPROVED);\n         $em = $this->getServiceManager()->get('Doctrine\\ORM\\EntityManager');\n         $em->persist($activity);\n         $em->flush();\n     }\n+\n+    /*\n+     * Some general ACL functions\n+     */\n+\n+    /**\n+     * Checks if the user is allowed to view the activity, and if not, throws an used permission exception\n+     */\n+    public function permissionViewActivityOrException()","path":"module/Activity/src/Activity/Service/Activity.php","position":133,"original_position":133,"commit_id":"121a8c40554ba5b17b0104ff76da14ec819303ec","original_commit_id":"121a8c40554ba5b17b0104ff76da14ec819303ec","user":{"login":"kokx","id":138556,"avatar_url":"https://avatars.githubusercontent.com/u/138556?v=3","gravatar_id":"","url":"https://api.github.com/users/kokx","html_url":"https://github.com/kokx","followers_url":"https://api.github.com/users/kokx/followers","following_url":"https://api.github.com/users/kokx/following{/other_user}","gists_url":"https://api.github.com/users/kokx/gists{/gist_id}","starred_url":"https://api.github.com/users/kokx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokx/subscriptions","organizations_url":"https://api.github.com/users/kokx/orgs","repos_url":"https://api.github.com/users/kokx/repos","events_url":"https://api.github.com/users/kokx/events{/privacy}","received_events_url":"https://api.github.com/users/kokx/received_events","type":"User","site_admin":false},"body":"I don't think that we have to worry a lot about the ACL being too granular, because we configure it in one place. I do agree that approve and disapprove are closely related (it would actually be weird to split those), but I'm not so sure about reset there.\r\n\r\nAnyway, I am not sure on my opinion on the second part. Indeed, it is true that including that check in the function itself isn't DRY. But neither is this solution (to be DRY here, you would have to combine everything into one function, but that would also clutter things in a different way).","created_at":"2015-12-15T20:08:42Z","updated_at":"2015-12-15T20:08:42Z","html_url":"https://github.com/GEWIS/gewisweb/pull/301#discussion_r47691088","pull_request_url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301","_links":{"self":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/comments/47691088"},"html":{"href":"https://github.com/GEWIS/gewisweb/pull/301#discussion_r47691088"},"pull_request":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301"}}},"pull_request":{"url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301","id":53723559,"html_url":"https://github.com/GEWIS/gewisweb/pull/301","diff_url":"https://github.com/GEWIS/gewisweb/pull/301.diff","patch_url":"https://github.com/GEWIS/gewisweb/pull/301.patch","issue_url":"https://api.github.com/repos/GEWIS/gewisweb/issues/301","number":301,"state":"open","locked":false,"title":"Activity ACL ","user":{"login":"stefanmajoor","id":7164637,"avatar_url":"https://avatars.githubusercontent.com/u/7164637?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmajoor","html_url":"https://github.com/stefanmajoor","followers_url":"https://api.github.com/users/stefanmajoor/followers","following_url":"https://api.github.com/users/stefanmajoor/following{/other_user}","gists_url":"https://api.github.com/users/stefanmajoor/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmajoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmajoor/subscriptions","organizations_url":"https://api.github.com/users/stefanmajoor/orgs","repos_url":"https://api.github.com/users/stefanmajoor/repos","events_url":"https://api.github.com/users/stefanmajoor/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmajoor/received_events","type":"User","site_admin":false},"body":"Fixes issue #296 \r\n\r\n@kokx can you confirm that this is the correct way to do the acl?","created_at":"2015-12-15T16:07:17Z","updated_at":"2015-12-15T20:08:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc21408265d62e95e2e2c9ae9f32b9b2de8a9c71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301/commits","review_comments_url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301/comments","review_comment_url":"https://api.github.com/repos/GEWIS/gewisweb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GEWIS/gewisweb/issues/301/comments","statuses_url":"https://api.github.com/repos/GEWIS/gewisweb/statuses/121a8c40554ba5b17b0104ff76da14ec819303ec","head":{"label":"stefanmajoor:feature/activity/acl","ref":"feature/activity/acl","sha":"121a8c40554ba5b17b0104ff76da14ec819303ec","user":{"login":"stefanmajoor","id":7164637,"avatar_url":"https://avatars.githubusercontent.com/u/7164637?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmajoor","html_url":"https://github.com/stefanmajoor","followers_url":"https://api.github.com/users/stefanmajoor/followers","following_url":"https://api.github.com/users/stefanmajoor/following{/other_user}","gists_url":"https://api.github.com/users/stefanmajoor/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmajoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmajoor/subscriptions","organizations_url":"https://api.github.com/users/stefanmajoor/orgs","repos_url":"https://api.github.com/users/stefanmajoor/repos","events_url":"https://api.github.com/users/stefanmajoor/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmajoor/received_events","type":"User","site_admin":false},"repo":{"id":22061296,"name":"gewisweb","full_name":"stefanmajoor/gewisweb","owner":{"login":"stefanmajoor","id":7164637,"avatar_url":"https://avatars.githubusercontent.com/u/7164637?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmajoor","html_url":"https://github.com/stefanmajoor","followers_url":"https://api.github.com/users/stefanmajoor/followers","following_url":"https://api.github.com/users/stefanmajoor/following{/other_user}","gists_url":"https://api.github.com/users/stefanmajoor/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmajoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmajoor/subscriptions","organizations_url":"https://api.github.com/users/stefanmajoor/orgs","repos_url":"https://api.github.com/users/stefanmajoor/repos","events_url":"https://api.github.com/users/stefanmajoor/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmajoor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanmajoor/gewisweb","description":"GEWIS Website","fork":true,"url":"https://api.github.com/repos/stefanmajoor/gewisweb","forks_url":"https://api.github.com/repos/stefanmajoor/gewisweb/forks","keys_url":"https://api.github.com/repos/stefanmajoor/gewisweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanmajoor/gewisweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanmajoor/gewisweb/teams","hooks_url":"https://api.github.com/repos/stefanmajoor/gewisweb/hooks","issue_events_url":"https://api.github.com/repos/stefanmajoor/gewisweb/issues/events{/number}","events_url":"https://api.github.com/repos/stefanmajoor/gewisweb/events","assignees_url":"https://api.github.com/repos/stefanmajoor/gewisweb/assignees{/user}","branches_url":"https://api.github.com/repos/stefanmajoor/gewisweb/branches{/branch}","tags_url":"https://api.github.com/repos/stefanmajoor/gewisweb/tags","blobs_url":"https://api.github.com/repos/stefanmajoor/gewisweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanmajoor/gewisweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanmajoor/gewisweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanmajoor/gewisweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanmajoor/gewisweb/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanmajoor/gewisweb/languages","stargazers_url":"https://api.github.com/repos/stefanmajoor/gewisweb/stargazers","contributors_url":"https://api.github.com/repos/stefanmajoor/gewisweb/contributors","subscribers_url":"https://api.github.com/repos/stefanmajoor/gewisweb/subscribers","subscription_url":"https://api.github.com/repos/stefanmajoor/gewisweb/subscription","commits_url":"https://api.github.com/repos/stefanmajoor/gewisweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanmajoor/gewisweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanmajoor/gewisweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanmajoor/gewisweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanmajoor/gewisweb/contents/{+path}","compare_url":"https://api.github.com/repos/stefanmajoor/gewisweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanmajoor/gewisweb/merges","archive_url":"https://api.github.com/repos/stefanmajoor/gewisweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanmajoor/gewisweb/downloads","issues_url":"https://api.github.com/repos/stefanmajoor/gewisweb/issues{/number}","pulls_url":"https://api.github.com/repos/stefanmajoor/gewisweb/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanmajoor/gewisweb/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanmajoor/gewisweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanmajoor/gewisweb/labels{/name}","releases_url":"https://api.github.com/repos/stefanmajoor/gewisweb/releases{/id}","created_at":"2014-07-21T11:03:51Z","updated_at":"2015-05-04T19:47:30Z","pushed_at":"2015-12-15T16:48:56Z","git_url":"git://github.com/stefanmajoor/gewisweb.git","ssh_url":"git@github.com:stefanmajoor/gewisweb.git","clone_url":"https://github.com/stefanmajoor/gewisweb.git","svn_url":"https://github.com/stefanmajoor/gewisweb","homepage":null,"size":4279,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"GEWIS:master","ref":"master","sha":"602ab04990a9f5f3f188ee86b9d23be73bfc475f","user":{"login":"GEWIS","id":1815510,"avatar_url":"https://avatars.githubusercontent.com/u/1815510?v=3","gravatar_id":"","url":"https://api.github.com/users/GEWIS","html_url":"https://github.com/GEWIS","followers_url":"https://api.github.com/users/GEWIS/followers","following_url":"https://api.github.com/users/GEWIS/following{/other_user}","gists_url":"https://api.github.com/users/GEWIS/gists{/gist_id}","starred_url":"https://api.github.com/users/GEWIS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GEWIS/subscriptions","organizations_url":"https://api.github.com/users/GEWIS/orgs","repos_url":"https://api.github.com/users/GEWIS/repos","events_url":"https://api.github.com/users/GEWIS/events{/privacy}","received_events_url":"https://api.github.com/users/GEWIS/received_events","type":"Organization","site_admin":false},"repo":{"id":16512277,"name":"gewisweb","full_name":"GEWIS/gewisweb","owner":{"login":"GEWIS","id":1815510,"avatar_url":"https://avatars.githubusercontent.com/u/1815510?v=3","gravatar_id":"","url":"https://api.github.com/users/GEWIS","html_url":"https://github.com/GEWIS","followers_url":"https://api.github.com/users/GEWIS/followers","following_url":"https://api.github.com/users/GEWIS/following{/other_user}","gists_url":"https://api.github.com/users/GEWIS/gists{/gist_id}","starred_url":"https://api.github.com/users/GEWIS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GEWIS/subscriptions","organizations_url":"https://api.github.com/users/GEWIS/orgs","repos_url":"https://api.github.com/users/GEWIS/repos","events_url":"https://api.github.com/users/GEWIS/events{/privacy}","received_events_url":"https://api.github.com/users/GEWIS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GEWIS/gewisweb","description":"GEWIS Website","fork":false,"url":"https://api.github.com/repos/GEWIS/gewisweb","forks_url":"https://api.github.com/repos/GEWIS/gewisweb/forks","keys_url":"https://api.github.com/repos/GEWIS/gewisweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GEWIS/gewisweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GEWIS/gewisweb/teams","hooks_url":"https://api.github.com/repos/GEWIS/gewisweb/hooks","issue_events_url":"https://api.github.com/repos/GEWIS/gewisweb/issues/events{/number}","events_url":"https://api.github.com/repos/GEWIS/gewisweb/events","assignees_url":"https://api.github.com/repos/GEWIS/gewisweb/assignees{/user}","branches_url":"https://api.github.com/repos/GEWIS/gewisweb/branches{/branch}","tags_url":"https://api.github.com/repos/GEWIS/gewisweb/tags","blobs_url":"https://api.github.com/repos/GEWIS/gewisweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GEWIS/gewisweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GEWIS/gewisweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/GEWIS/gewisweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GEWIS/gewisweb/statuses/{sha}","languages_url":"https://api.github.com/repos/GEWIS/gewisweb/languages","stargazers_url":"https://api.github.com/repos/GEWIS/gewisweb/stargazers","contributors_url":"https://api.github.com/repos/GEWIS/gewisweb/contributors","subscribers_url":"https://api.github.com/repos/GEWIS/gewisweb/subscribers","subscription_url":"https://api.github.com/repos/GEWIS/gewisweb/subscription","commits_url":"https://api.github.com/repos/GEWIS/gewisweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/GEWIS/gewisweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/GEWIS/gewisweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/GEWIS/gewisweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/GEWIS/gewisweb/contents/{+path}","compare_url":"https://api.github.com/repos/GEWIS/gewisweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GEWIS/gewisweb/merges","archive_url":"https://api.github.com/repos/GEWIS/gewisweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GEWIS/gewisweb/downloads","issues_url":"https://api.github.com/repos/GEWIS/gewisweb/issues{/number}","pulls_url":"https://api.github.com/repos/GEWIS/gewisweb/pulls{/number}","milestones_url":"https://api.github.com/repos/GEWIS/gewisweb/milestones{/number}","notifications_url":"https://api.github.com/repos/GEWIS/gewisweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GEWIS/gewisweb/labels{/name}","releases_url":"https://api.github.com/repos/GEWIS/gewisweb/releases{/id}","created_at":"2014-02-04T13:22:05Z","updated_at":"2015-05-06T10:10:51Z","pushed_at":"2015-12-15T16:48:56Z","git_url":"git://github.com/GEWIS/gewisweb.git","ssh_url":"git@github.com:GEWIS/gewisweb.git","clone_url":"https://github.com/GEWIS/gewisweb.git","svn_url":"https://github.com/GEWIS/gewisweb","homepage":null,"size":4708,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":70,"forks":12,"open_issues":70,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301"},"html":{"href":"https://github.com/GEWIS/gewisweb/pull/301"},"issue":{"href":"https://api.github.com/repos/GEWIS/gewisweb/issues/301"},"comments":{"href":"https://api.github.com/repos/GEWIS/gewisweb/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GEWIS/gewisweb/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/GEWIS/gewisweb/statuses/121a8c40554ba5b17b0104ff76da14ec819303ec"}}}}