本文整理汇总了PHP中CIBlockElement::WF_GetStatusPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::WF_GetStatusPermission方法的具体用法?PHP CIBlockElement::WF_GetStatusPermission怎么用?PHP CIBlockElement::WF_GetStatusPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::WF_GetStatusPermission方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowError
$this->AbortResultCache();
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
if ($arParams["ELEMENT_ID"] > 0) {
$ELEMENT_ID = $arParams["ELEMENT_ID"];
} else {
//Handle case when ELEMENT_CODE used
$ELEMENT_ID = CIBlockFindTools::GetElementID($arParams["ELEMENT_ID"], $arParams["ELEMENT_CODE"], false, false, array("IBLOCK_ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"], "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"));
}
if ($ELEMENT_ID) {
$WF_SHOW_HISTORY = "N";
if ($arParams["SHOW_WORKFLOW"] && CModule::IncludeModule("workflow")) {
$WF_ELEMENT_ID = CIBlockElement::WF_GetLast($ELEMENT_ID);
$WF_STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ELEMENT_ID, $WF_STATUS_TITLE);
$WF_STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($WF_STATUS_ID);
if ($WF_STATUS_ID == 1 || $WF_STATUS_PERMISSION < 1) {
$WF_ELEMENT_ID = $ELEMENT_ID;
} else {
$WF_SHOW_HISTORY = "Y";
}
$ELEMENT_ID = $WF_ELEMENT_ID;
}
//SELECT
$arSelect = array_merge($arParams["FIELD_CODE"], array("ID", "CODE", "IBLOCK_ID", "IBLOCK_SECTION_ID", "SECTION_PAGE_URL", "NAME", "DETAIL_PICTURE", "PREVIEW_PICTURE", "DETAIL_TEXT", "DETAIL_PAGE_URL", "PREVIEW_TEXT_TYPE", "DETAIL_TEXT_TYPE"));
$bGetProperty = count($arParams["PROPERTY_CODE"]) > 0 || $arParams["BROWSER_TITLE"] != "-" || $arParams["META_KEYWORDS"] != "-" || $arParams["META_DESCRIPTION"] != "-";
if ($bGetProperty) {
$arSelect[] = "PROPERTY_*";
}
//WHERE
$arFilter = array("ID" => $ELEMENT_ID, "IBLOCK_ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"], "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y", "SHOW_HISTORY" => $WF_SHOW_HISTORY);
示例2: GetMessage
"TEXT" => GetMessage("IBLIST_A_ORIG_ED"),
"TITLE" => GetMessage("IBLIST_A_ORIG_ED_TITLE"),
"ACTION" => $lAdmin->ActionRedirect(CIBlock::GetAdminElementEditLink($IBLOCK_ID, $arRes_orig['ID'], array(
'WF' => 'Y',
'find_section_section' => intval($find_section_section)
)))
);
}
if (
CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $f_ID, "element_delete")
&& (2 <= $STATUS_PERMISSION)
)
{
if (!CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $f_ID, "element_edit_any_wf_status"))
$intMinPerm = CIBlockElement::WF_GetStatusPermission($arRes["WF_STATUS_ID"], $f_ID);
if (2 <= $intMinPerm)
{
$arActions[] = array("SEPARATOR"=>true);
$arActions[] = array(
"ICON" => "delete",
"TEXT" => GetMessage('MAIN_DELETE'),
"TITLE" => GetMessage("IBLOCK_DELETE_ALT"),
"ACTION" => "if(confirm('".GetMessageJS('IBLOCK_CONFIRM_DEL_MESSAGE')."')) ".$lAdmin->ActionDoGroup($f_TYPE.$arRes_orig['ID'], "delete", $sThisSectionUrl),
);
}
}
}
}
elseif($bBizproc)
{
示例3: GetMessage
else
{
if(!CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $_POST["IBLOCK_SECTION"], "section_element_bind"))
unset($_POST["IBLOCK_SECTION"]);
}
}
if(!(check_bitrix_sessid() || $_SESSION['IBLOCK_CUSTOM_FORM']===true))
{
$strWarning .= GetMessage("IBLOCK_WRONG_SESSION")."<br>";
$error = new _CIBlockError(2, "BAD_SAVE", $strWarning);
$bVarsFromForm = true;
}
elseif($WF=="Y" && $bWorkflow && intval($_POST["WF_STATUS_ID"])<=0)
$strWarning .= GetMessage("IBLOCK_WRONG_WF_STATUS")."<br>";
elseif($WF=="Y" && $bWorkflow && CIBlockElement::WF_GetStatusPermission($_POST["WF_STATUS_ID"])<1)
$strWarning .= GetMessage("IBLOCK_ACCESS_DENIED_STATUS")." [".$_POST["WF_STATUS_ID"]."]."."<br>";
elseif(0 >= $ID && !isset($_POST["IBLOCK_SECTION"]) && !CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "section_element_bind"))
$strWarning .= GetMessage("IBLOCK_ACCESS_DENIED_SECTION")."<br>";
elseif(!$customTabber->Check())
{
if($ex = $APPLICATION->GetException())
$strWarning .= $ex->GetString();
else
$strWarning .= "Error. ";
}
else
{
if ($bCatalog)
{
$arCatalogItem = array(
示例4: array
$arResult["ELEMENT"]["URL"]["UPLOAD"] = CComponentEngine::MakePathFromTemplate($arParams["ELEMENT_UPLOAD_URL"], array("PATH" => $path, "SECTION_ID" => $arParams["SECTION_ID"]));
$arResult["URL"] = array("WEBDAV_START_BIZPROC" => $arResult["ELEMENT"]["URL"]["BP_START"], "BP" => $arResult["ELEMENT"]["URL"]["BP"]);
$arResult["~ELEMENT"] = $arResult["ELEMENT"];
/********************************************************************
/Data
********************************************************************/
/********************************************************************
Data
********************************************************************/
$arResult["SECTION_LIST"] = $ob->GetSectionsTree(array("path" => "/"));
if ($arParams["USE_WORKFLOW"] == "Y") {
$db_res = CWorkflowStatus::GetDropDownList($arParams["PERMISSION"] < "W" ? "N" : "Y", "desc");
if ($db_res && ($res = $db_res->Fetch())) {
do {
$arResult["WF_STATUSES"][intVal($res["REFERENCE_ID"])] = $res["REFERENCE"];
$arResult["WF_STATUSES_PERMISSION"][intVal($res["REFERENCE_ID"])] = $arParams["PERMISSION"] < "W" ? CIBlockElement::WF_GetStatusPermission($res["REFERENCE_ID"]) : 2;
if ($arResult["WF_STATUSES_PERMISSION"][intVal($res["REFERENCE_ID"])] == 2) {
$iEditStatus = intVal($res["REFERENCE_ID"]);
}
} while ($res = $db_res->Fetch());
}
}
/********************************************************************
/Data
********************************************************************/
/********************************************************************
Actions
********************************************************************/
if (($arResult['ELEMENT']['SHOW']['EDIT'] === "Y" || $arResult['ELEMENT']['SHOW']['DELETE'] === "Y" || $arResult['ELEMENT']['SHOW']['UNDELETE'] === "Y" || $arResult['ELEMENT']['SHOW']['LOCK'] === "Y" || $arResult['ELEMENT']['SHOW']['UNLOCK'] === "Y") && (strToUpper($_REQUEST['edit']) == "Y" || strToUpper($_REQUEST['EDIT']) == "Y" || strToUpper($_REQUEST['LOCK']) == "Y" || strToUpper($_REQUEST['UNLOCK']) == "Y")) {
$result = (include str_replace(array("\\", "//"), "/", dirname(__FILE__) . "/action.php"));
if ($result !== true) {
示例5: intval
if (strlen($ID) <= 0) {
continue;
}
$ID = intval($ID);
$arRes = CIBlockElement::GetByID($ID);
$arRes = $arRes->Fetch();
if (!$arRes) {
continue;
}
$bPermissions = false;
//delete and modify can:
if (CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit_any_wf_status ")) {
$bPermissions = true;
} else {
//For delete action we have to check all statuses in element history
$STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($arRes["WF_STATUS_ID"], $_REQUEST['action'] == "delete" ? $ID : false);
if ($STATUS_PERMISSION >= 2) {
$bPermissions = true;
}
}
if (!$bPermissions) {
$lAdmin->AddGroupError(GetMessage("IBLOCK_ADM_HISTORY_UPDERR3") . " (ID:" . $ID . ")", $ID);
continue;
}
switch ($_REQUEST['action']) {
case "delete":
$d = CIBlockElement::GetByID($ID);
if ($dr = $d->Fetch()) {
if (strlen($dr["WF_PARENT_ELEMENT_ID"]) > 0) {
$DB->StartTransaction();
if (!CIBlockElement::Delete(intval($ID))) {
示例6: CheckWebRights
//.........这里部分代码省略.........
}
} else {
$res = $this->GetPermission($type, $arElement['item_id'], 'section_delete', false);
if (!$res) {
$arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
}
}
} elseif ($action == 'destroy') {
//arElement
$id = $arElement['item_id'];
$type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
$op = $arElement['is_dir'] ? 'section_delete' : 'element_delete';
if (!$this->GetPermission($type, $id, $op, false)) {
$arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
}
} elseif ($action == 'edit' || $action == 'lock' || $action == 'proppatch' || $action == 'delete_dropped') {
//arElement
$id = $arElement['item_id'];
$type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
if ($arElement['is_dir']) {
if (!$this->GetPermission($type, $id, 'section_edit')) {
$arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
}
} else {
if ($arElement["LOCK_STATUS_BP"] == "red") {
$arError[] = array("id" => "locked", "text" => GetMessage("WD_FILE_ERROR107"));
} elseif ($this->check_creator && $arElement["CREATED_BY"] != $GLOBALS["USER"]->GetID()) {
$arError[] = array("id" => "bad_author", "text" => GetMessage("WD_FILE_ERROR108"));
} elseif ($this->GetPermission($type, $id, 'element_edit_any_wf_status')) {
true;
} elseif ($this->workflow == "workflow" && $this->GetPermission($type, $id, 'element_edit')) {
$arWorkFlow = array("LAST_ID" => CIBlockElement::WF_GetLast($arElement["item_id"]));
$arWorkFlow["STATUS_ID"] = CIBlockElement::WF_GetCurrentStatus($arWorkFlow["LAST_ID"], $arWorkFlow["STATUS_TITLE"]);
$arWorkFlow["STATUS_PERMISSION"] = CIBlockElement::WF_GetStatusPermission($arWorkFlow["STATUS_ID"]);
if ($arWorkFlow["STATUS_ID"] > 1 && $arWorkFlow["STATUS_PERMISSION"] < 2) {
$arError[] = array("id" => "bad_wf_status_permission", "text" => GetMessage("WD_FILE_ERROR109"));
}
} elseif ($this->workflow == 'bizproc' && $this->GetPermission($type, $id, 'element_edit')) {
$documentId = $this->wfParams['DOCUMENT_TYPE'];
$documentId[2] = $arElement["item_id"];
$arDocumentStates = CBPDocument::GetDocumentStates($this->wfParams['DOCUMENT_TYPE'], $documentId);
$arUserGroups = $this->USER["GROUPS"];
if ($arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
$arUserGroups[] = "Author";
}
if (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $GLOBALS["USER"]->GetID(), $documentId, array("IBlockPermission" => $this->permission, "AllUserGroups" => $arUserGroups, "DocumentStates" => $arDocumentStates))) {
$arError[] = array("id" => "bad_bizproc_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
}
} else {
$arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
}
}
} elseif ($action == 'read' || $action == 'propfind') {
//arElement, null
if ($arElement) {
$id = $arElement['item_id'];
$type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
$op = $arElement['is_dir'] ? 'section_read' : 'element_read';
if (!$this->GetPermission($type, $id, $op)) {
$arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
}
if ($type == 'SECTION' && $id == $this->GetMetaID('TRASH')) {
if (!$this->GetPermission($type, $id, 'section_delete')) {
$arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
}
}