Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r16560 -r16563 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16560) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16563) @@ -1,6 +1,6 @@ Application->GetVar('admin') ) { + // User can't edit anything. + kUtil::safeDefine('EDITING_MODE', ''); + + return; + } + + /** @var Session $admin_session */ + $admin_session = $this->Application->recallObject('Session.admin'); + + // Store Admin Console User's ID to Front-End's session for cross-session permission checks. + $this->Application->StoreVar('admin_user_id', (int)$admin_session->RecallVar('user_id')); + + $base_category = $this->Application->getBaseCategory(); + + if ( $this->Application->CheckAdminPermission('CATEGORY.MODIFY', 0, $base_category) ) { + // User can edit cms blocks (when viewing front-end through admin's frame). + $editing_mode = $this->Application->GetVar('editing_mode'); + define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE); + } + + // User can't edit anything. + kUtil::safeDefine('EDITING_MODE', ''); + } + + /** * Set's mark, that root category is edited * * @param kEvent $event