public function GetAllowableOperations($documentType) { $iblockId = intval(substr($documentType, strlen("iblock_"))); if ($iblockId <= 0) { throw new CBPArgumentOutOfRangeException("documentType", $documentType); } if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") { $ob = new CIBlockRights($iblockId); return $ob->GetRightsList(); } return array("read" => GetMessage("IBD_OPERATION_READ"), "write" => GetMessage("IBD_OPERATION_WRITE")); }
?> <tr> <td width="40%" class="adm-detail-valign-top"><label for="RIGHTS_MODE"><?php echo GetMessage("IB_E_RIGHTS_MODE"); ?> </label></td> <td width="60%"> <input type="hidden" name="RIGHTS_MODE" value="S"> <input type="checkbox" id="RIGHTS_MODE" name="RIGHTS_MODE" value="E" checked="checked"><?php echo BeginNote(), GetMessage("IB_E_RIGHTS_MODE_NOTE1"), EndNote(); ?> </td> </tr> <?php $obIBlockRights = new CIBlockRights($ID); IBlockShowRights('iblock', $ID, $ID, GetMessage("IB_E_RIGHTS_SECTION_TITLE"), "RIGHTS", $obIBlockRights->GetRightsList(), $obIBlockRights->GetRights(array("count_overwrited" => true)), true); ?> <tr> <td colspan="2"> </td> </tr> <?php } else { ?> <tr> <td width="40%" class="adm-detail-valign-top"><label for="RIGHTS_MODE"><?php echo GetMessage("IB_E_RIGHTS_MODE"); ?> </label></td> <td width="60%"> <input type="hidden" name="RIGHTS_MODE" value="S"> <input type="checkbox" id="RIGHTS_MODE" name="RIGHTS_MODE" value="E"><?php
<tr> <td width="40%" class="adm-detail-valign-top"><label for="RIGHTS_MODE"><?echo GetMessage("IB_E_RIGHTS_MODE")?></label></td> <td width="60%"> <input type="hidden" name="RIGHTS_MODE" value="S"> <input type="checkbox" id="RIGHTS_MODE" name="RIGHTS_MODE" value="E" checked="checked"><?echo BeginNote(), GetMessage("IB_E_RIGHTS_MODE_NOTE1"), EndNote()?> </td> </tr> <? $obIBlockRights = new CIBlockRights($ID); IBlockShowRights( 'iblock', $ID, $ID, GetMessage("IB_E_RIGHTS_SECTION_TITLE"), "RIGHTS", $obIBlockRights->GetRightsList(), $obIBlockRights->GetRights(array("count_overwrited" => true)), true ); ?> <tr> <td colspan="2"> </td> </tr> <?else:?> <tr> <td width="40%" class="adm-detail-valign-top"><label for="RIGHTS_MODE"><?echo GetMessage("IB_E_RIGHTS_MODE")?></label></td> <td width="60%"> <input type="hidden" name="RIGHTS_MODE" value="S"> <input type="checkbox" id="RIGHTS_MODE" name="RIGHTS_MODE" value="E"><?echo BeginNote(), GetMessage("IB_E_RIGHTS_MODE_NOTE2"), EndNote()?> </td> </tr>
if (preg_match("/^G(\\d)\$/", $arRight["GROUP_CODE"], $match) && is_array($arListsPerm) && in_array($match[1], $arListsPerm)) { unset($arResult["RIGHTS"][$RIGHT_ID]); $arResult["SELECTED"][$arRight["GROUP_CODE"]] = true; } else { //2) protect groups with iblock_% operations $arOperations = CTask::GetOperations($arRight['TASK_ID'], true); foreach ($arOperations as $operation) { if (preg_match("/^iblock_(?!admin)/", $operation)) { unset($arResult["RIGHTS"][$RIGHT_ID]); $arResult["SELECTED"][$arRight["GROUP_CODE"]] = true; break; } } } } $arResult["TASKS"] = CIBlockRights::GetRightsList(); foreach ($arResult["TASKS"] as $TASK_ID => $label) { //2) protect tasks with iblock_% operations $arOperations = CTask::GetOperations($TASK_ID, true); foreach ($arOperations as $operation) { if (preg_match("/^iblock_(?!admin)/", $operation)) { unset($arResult["TASKS"][$TASK_ID]); break; } } } } $arResult["VARS_FROM_FORM"] = $bVarsFromForm; $arResult["FORM_DATA"] = array(); foreach ($data as $key => $value) { $arResult["FORM_DATA"]["~" . $key] = $value;
if ($dbIB && ($arIB = $dbIB->Fetch())) { $arResult['ENTITY_NAME'] = $arIB['NAME']; $arResult['ENTITY_PARENTS'][] = $arIB['IBLOCK_SECTION_ID']; } } if (sizeof($arResult['ENTITY_PARENTS']) > 0 && intval($arResult['ENTITY_PARENTS'][0]) > 0) { $dbChain = CIBlockSection::GetNavChain($arParams['IBLOCK_ID'], $arResult['ENTITY_PARENTS'][0]); if ($dbChain) { while ($arChain = $dbChain->Fetch()) { $arResult['ENTITY_PARENTS'][] = $arChain['IBLOCK_SECTION_ID']; } } } } if ($USER->CanDoOperation('webdav_change_settings') || $obIBlockRights && $obIBlockRights->UserHasRightTo($arParams['IBLOCK_ID'], $arParams['ENTITY_ID'], $checkOP)) { $arTasks = CIBlockRights::GetRightsList(); $arTaskLetters = CWebDavIblock::GetTasks(); //bad hack. It's not public rights. if (isset($arTaskLetters['S'])) { unset($arTasks[$arTaskLetters['S']]); } if (isset($arTaskLetters['T'])) { unset($arTasks[$arTaskLetters['T']]); } $arResult['PERMISSIONS'] = $arTasks; if (!$bCreate) { $arRightParams = array("count_overwrited" => true); if (!empty($arResult['ENTITY_PARENTS'])) { $arRightParams['parents'] = $arResult['ENTITY_PARENTS']; } $arCurrent = $obIBlockRights->GetRights($arRightParams);