GitHub PullRequestReviewCommentEvent at 2014-04-16 02:58:42
Repository: odalc
Actor: akakitani
Payload: {"comment":{"url":"https://api.github.com/repos/calblueprint/odalc/pulls/comments/11668299","id":11668299,"diff_hunk":"@@ -48,6 +49,17 @@ def child(self):\n             except ObjectDoesNotExist:\n                 pass\n \n+class UserPerm(models.Model):","path":"odalc/base/models.py","position":24,"original_position":24,"commit_id":"adf7e27e02b2ad6b13d073fffbe1e6df02f2d5a6","original_commit_id":"adf7e27e02b2ad6b13d073fffbe1e6df02f2d5a6","user":{"login":"akakitani","id":1501088,"avatar_url":"https://avatars.githubusercontent.com/u/1501088?","gravatar_id":"a39cec81a7c44860a2a62edc4ce7e5a4","url":"https://api.github.com/users/akakitani","html_url":"https://github.com/akakitani","followers_url":"https://api.github.com/users/akakitani/followers","following_url":"https://api.github.com/users/akakitani/following{/other_user}","gists_url":"https://api.github.com/users/akakitani/gists{/gist_id}","starred_url":"https://api.github.com/users/akakitani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akakitani/subscriptions","organizations_url":"https://api.github.com/users/akakitani/orgs","repos_url":"https://api.github.com/users/akakitani/repos","events_url":"https://api.github.com/users/akakitani/events{/privacy}","received_events_url":"https://api.github.com/users/akakitani/received_events","type":"User","site_admin":false},"body":"It doesn't look like you're really using this model in your code, what did you want to do with it?\r\n\r\nI'm guessing you probably saw this https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#custom-permissions , which is really used for setting permissions on a per-table basis.\r\n\r\nFor example, you can have the Meta class and the \"permissions\" tuples in the Course model to be something like \"can_edit\", \"can_delete\", etc. and you would assign/check those permissions for when users are interacting with the Course objects. In our case, permissions for editing courses are on a per-row basis, since only admins and the teacher who owns the course can edit them, so what you're doing in the views works!","created_at":"2014-04-16T02:58:42Z","updated_at":"2014-04-16T02:58:42Z","html_url":"https://github.com/calblueprint/odalc/pull/45#discussion_r11668299","pull_request_url":"https://api.github.com/repos/calblueprint/odalc/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/calblueprint/odalc/pulls/comments/11668299"},"html":{"href":"https://github.com/calblueprint/odalc/pull/45#discussion_r11668299"},"pull_request":{"href":"https://api.github.com/repos/calblueprint/odalc/pulls/45"}}}}