Index: trunk/core/units/general/helpers/permissions_helper.php =================================================================== diff -u -N -r8360 -r8363 --- trunk/core/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 8360) +++ trunk/core/units/general/helpers/permissions_helper.php (.../permissions_helper.php) (revision 8363) @@ -147,7 +147,7 @@ if (!$id) { // item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions - $category_id = $this->Application->RecallVar('m_cat_id'); + $category_id = $this->Application->IsAdmin() ? $this->Application->RecallVar('m_cat_id') : $this->Application->GetVar('m_cat_id'); } elseif ($top_prefix == 'c') { $category_id = $id; @@ -167,14 +167,19 @@ if (substr($event->Name, 0, 9) == 'OnPreSave' || $event->Name == 'OnCreate' || $event->Name == 'OnUpdate') { if ($event_handler->isNewItemCreate($event)) { - return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || - $this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id); + $check_status = $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || + $this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id); } else { - return $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || - $this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id) || - $this->ModifyCheckPermission($owner_id, $category_id, $top_prefix); + $check_status = $this->CheckPermission($item_prefix.'.ADD', 0, $category_id) || + $this->CheckPermission($item_prefix.'.ADD.PENDING', 0, $category_id) || + $this->ModifyCheckPermission($owner_id, $category_id, $top_prefix); } + + if (!$check_status) { + $event->status = erPERM_FAIL; + } + return $check_status; } $perm_status = false;