#NEWLINE# def has_object_permission( self , request , view , obj ) : #NEWLINE# #INDENT# assert isinstance ( obj , Comment ) , 'obj must be a Comment, got {}' . format ( obj ) #NEWLINE# auth = get_user_auth ( request ) #NEWLINE# comment = obj #NEWLINE# node = obj . node #NEWLINE# if ( request . method in permissions . SAFE_METHODS ) : #NEWLINE# #INDENT# return ( node . is_public or node . can_view ( auth ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( ( comment . user . _id == auth . user . _id ) and node . can_comment ( auth ) )