fixed bug #7283: When editing a shortcut in backend.php regular users get global...
authorIngo Renner <ingo.renner@typo3.org>
Sat, 26 Jan 2008 16:29:39 +0000 (16:29 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Sat, 26 Jan 2008 16:29:39 +0000 (16:29 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2971 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/classes/class.shortcutmenu.php

index ec4dd63..1a64652 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
        * fixed bug #7255: implement "auto-closing brackets", credits Tobias Liebig
        * fixed bug: when refreshing the module menu, the currently highlighted module losses highlighting
        * added visual effects to collapsing/expanding module menus
+       * fixed bug #7283: When editing a shortcut in backend.php regular users get global groups shown in the group select field but can't save to them
 
 2008-01-26  Oliver Hader  <oh@inpublica.de>
 
index 825d292..b87fabd 100644 (file)
@@ -409,10 +409,17 @@ class ShortcutMenu implements backend_toolbarItem {
         * @return      void
         */
        public function getAjaxShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = null) {
+               $shortcutGroups = $this->shortcutGroups;
 
-               //TODO remove global (negative id) groups if the user is no admin !!!
+               if(!$GLOBALS['BE_USER']->isAdmin()) {
+                       foreach($shortcutGroups as $groupId => $groupName) {
+                               if(intval($groupId) < 0) {
+                                       unset($shortcutGroups[$groupId]);
+                               }
+                       }
+               }
 
-               $ajaxObj->addContent('shortcutGroups', $this->shortcutGroups);
+               $ajaxObj->addContent('shortcutGroups', $shortcutGroups);
                $ajaxObj->setContentFormat('json');
        }