Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/db/cat_tag_processor.php
Show First 20 Lines • Show All 943 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Returns list of categories, that have add/edit permission for current category item type | * Returns list of categories, that have add/edit permission for current category item type | ||||
* | * | ||||
* @param Array $params | * @param Array $params | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
function AllowedCategoriesJSON($params) | function AllowedCategoriesJSON($params) | ||||
{ | { | ||||
if ( $this->Application->RecallVar('user_id') == USER_ROOT ) { | if ( $this->Application->permissionCheckingDisabled() ) { | ||||
$categories = true; | $categories = true; | ||||
} | } | ||||
else { | else { | ||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | /* @var $object kDBItem */ | ||||
$perm_helper = $this->Application->recallObject('PermissionsHelper'); | $perm_helper = $this->Application->recallObject('PermissionsHelper'); | ||||
/* @var $perm_helper kPermissionsHelper */ | /* @var $perm_helper kPermissionsHelper */ | ||||
$perm_prefix = $this->getUnitConfig()->getPermItemPrefix(); | $perm_prefix = $this->getUnitConfig()->getPermItemPrefix(); | ||||
$categories = $perm_helper->getPermissionCategories($perm_prefix . '.' . ($object->IsNewItem() ? 'ADD' : 'MODIFY')); | $categories = $perm_helper->getPermissionCategories($perm_prefix . '.' . ($object->IsNewItem() ? 'ADD' : 'MODIFY')); | ||||
} | } | ||||
return json_encode($categories); | return json_encode($categories); | ||||
} | } | ||||
} | } |