Add missing permission checks in media manager
authorMatthias Schmidt <gravatronics@live.com>
Thu, 29 Sep 2016 08:24:08 +0000 (10:24 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 29 Sep 2016 08:46:47 +0000 (10:46 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Base.js

index e34b94c04aa8643c67895e490694446364bcc9c5..bdea218138b8aef6e498bfa9ef2cb669bb53edce 100644 (file)
@@ -98,7 +98,9 @@ define(
                 */
                _dialogClose: function() {
                        // only show media clipboard if editor is open
-                       Clipboard.hideEditor('com.woltlab.wcf.media');
+                       if (Permission.get('admin.content.cms.canManageMedia')) {
+                               Clipboard.hideEditor('com.woltlab.wcf.media');
+                       }
                },
                
                /**
@@ -187,7 +189,9 @@ define(
                        if (!this._mediaManagerMediaList) return;
                        
                        // only show media clipboard if editor is open
-                       Clipboard.showEditor('com.woltlab.wcf.media');
+                       if (Permission.get('admin.content.cms.canManageMedia')) {
+                               Clipboard.showEditor('com.woltlab.wcf.media');
+                       }
                },
                
                /**