Add team permission check on commentable_id.

TNL-2864
This commit is contained in:
cahrens
2015-07-22 17:24:07 -04:00
parent 7a32fbc941
commit 01c22531d7
5 changed files with 293 additions and 59 deletions

View File

@@ -5,5 +5,15 @@ from lms.lib.comment_client import settings
class Commentable(models.Model):
accessible_fields = ['id', 'commentable_id']
base_url = "{prefix}/commentables".format(prefix=settings.PREFIX)
type = 'commentable'
def retrieve(self, *args, **kwargs):
"""
Override default behavior because commentables don't actually exist in the comment service.
"""
self.attributes["commentable_id"] = self.attributes["id"]
self.retrieved = True
return self