@@ -201,6+207,9 @@ class User(BaseModel, DjangoUser):
def can_delete_comment(self, comment):\r
return self == comment.author or self.reputation >= int(settings.REP_TO_DELETE_COMMENTS)\r
\r
def can_delete_comment(self, comment):\r
return self == comment.author or self.reputation >= int(settings.REP_TO_DELETE_COMMENTS)\r
\r
+ def can_convert_to_comment(self, answer):\r
+ return (not answer.marked) and (self.is_superuser or self.is_staff or answer.author == self or self.reputation >= int(settings.REP_TO_CONVERT_TO_COMMENT))\r
+\r
@true_if_is_super_or_staff\r
def can_accept_answer(self, answer):\r
return self == answer.question.author\r
@true_if_is_super_or_staff\r
def can_accept_answer(self, answer):\r
return self == answer.question.author\r
@@ -208,7+217,11 @@ class User(BaseModel, DjangoUser):
@true_if_is_super_or_staff\r
def can_edit_post(self, post):\r
return self == post.author or self.reputation >= int(settings.REP_TO_EDIT_OTHERS\r
@true_if_is_super_or_staff\r
def can_edit_post(self, post):\r
return self == post.author or self.reputation >= int(settings.REP_TO_EDIT_OTHERS\r
- ) or (post.wiki and self.reputation >= int(settings.REP_TO_EDIT_WIKI))\r
+ ) or (post.nis.wiki and self.reputation >= int(settings.REP_TO_EDIT_WIKI))\r
+\r
+ @true_if_is_super_or_staff\r
+ def can_wikify(self, post):\r
+ return self == post.author or self.reputation >= int(settings.REP_TO_WIKIFY)\r