Add team permission check on commentable_id.
TNL-2864
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user