]> git.parisson.com Git - telemeta.git/commitdiff
add can_download_all_items perm, adapt media item view
authoryomguy <yomguy@parisson.com>
Fri, 24 Jun 2011 12:21:49 +0000 (14:21 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 24 Jun 2011 12:21:49 +0000 (14:21 +0200)
telemeta/models/media.py
telemeta/templates/telemeta_default/mediaitem_detail.html

index d232bf5124b14b1da067b438e2b29a3b4f8cadc6..8a7100008bb386156b848641232f399f5450414d 100644 (file)
@@ -285,9 +285,8 @@ class MediaItem(MediaResource):
 
     class Meta(MetaCore):
         db_table = 'media_items'
-        permissions = (
-                       ("can_play_all_items", "Can play all media items"), 
-                       )
+        permissions = (("can_play_all_items", "Can play all media items"), 
+                       ("can_download_all_items", "Can download all media items"), )
 
     def is_valid_code(self, code):
         "Check if the item code is well formed"
index 3ea054e469cc49be74190b59e0cd9ca2a5ce4768..0c3532f7fe3d6abde0b9b37f4c1f89f2f32f8c1c 100644 (file)
         </div>
         <!--</div>-->
 
-        {% if audio_export_enabled or user.is_staff or user.is_superuser %}
+        {% if audio_export_enabled or perms.telemeta.can_download_all_items or user.is_superuser %}
         <div class="exporter">
             <p><img src="{% url telemeta-images "download.png" %}" alt="download" style="vertical-align:middle" /> {% trans "Download:" %}
                 {% for format in export_formats %}