]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/user.py
OSQA-719, implements a new feature that allows administrators and moderators to manag...
[osqa.git] / forum / models / user.py
index e73244dc4a943b2050e58aeb343025ec2e0ff951..6ee7f663918b84674ad10ae7e7d46ad860adb261 100644 (file)
@@ -259,6 +259,14 @@ class User(BaseModel, DjangoUser):
         
         return votes_today
     
+    def can_use_canned_comments(self):
+        # The canned comments feature is available only for admins and moderators,
+        # and only if the "Use canned comments" setting is activated in the administration.
+        if (self.is_superuser or self.is_staff) and settings.USE_CANNED_COMMENTS:
+            return True
+        else:
+            return False
+
     @true_if_is_super_or_staff
     def can_view_deleted_post(self, post):
         return post.author == self