Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r5254 -r5431 --- trunk/kernel/include/category.php (.../category.php) (revision 5254) +++ trunk/kernel/include/category.php (.../category.php) (revision 5431) @@ -2330,16 +2330,27 @@ return $dest->Get("CategoryId"); } - function Delete_Category($Id) + function Delete_Category($Id, $check_perm = false) { global $objSession; $d =& $this->GetCategory($Id); - if(is_object($d)) - { - if($d->Get("CategoryId")==$Id) - { + if (is_object($d)) { + $perm_status = true; + if ($check_perm) { + if (defined('ADVANCED_VIEW') && ADVANCED_VIEW) { + // check by this cat parent category + $check_cat = $d->Get('ParentId'); + } + else { + // check by current category + $check_cat = $this->CurrentCategoryID(); + } + $perm_status = $objSession->HasCatPermission('CATEGORY.DELETE', $check_cat); + } + + if (($d->Get("CategoryId") == $Id) && $perm_status) { $d->SendUserEventMail("CATEGORY.DELETE",$objSession->Get("PortalUserId")); $d->SendAdminEventMail("CATEGORY.DELETE"); $p =& $this->GetCategory($d->Get("ParentId"));