当前位置: 首页>>代码示例>>PHP>>正文


PHP CGroup::SetModulePermission方法代码示例

本文整理汇总了PHP中CGroup::SetModulePermission方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroup::SetModulePermission方法的具体用法?PHP CGroup::SetModulePermission怎么用?PHP CGroup::SetModulePermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGroup的用法示例。


在下文中一共展示了CGroup::SetModulePermission方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
if ($arGroup = $dbGroup->Fetch()) {
    $userGroupID = $arGroup["ID"];
} else {
    $group = new CGroup();
    $arFields = array("ACTIVE" => "Y", "C_SORT" => 300, "NAME" => GetMessage("SALE_WIZARD_CONTENT_EDITOR"), "DESCRIPTION" => GetMessage("SALE_WIZARD_CONTENT_EDITOR_DESCR"), "USER_ID" => array(), "STRING_ID" => "content_editor");
    $userGroupID = $group->Add($arFields);
    $DB->Query("INSERT INTO b_sticker_group_task(GROUP_ID, TASK_ID)\tSELECT " . intVal($userGroupID) . ", ID FROM b_task WHERE NAME='stickers_edit' AND MODULE_ID='fileman'", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
}
if (IntVal($userGroupID) > 0) {
    WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "main", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "P"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "fileman", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "F"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
    $SiteDir = "";
    if (WIZARD_SITE_ID != "s1") {
        $SiteDir = "/site_" . WIZARD_SITE_ID;
    }
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/index.php"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/about/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/news/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/catalog/"), array($userGroupID => "W"));
    WizardServices::SetFilePermission(array($siteID, $SiteDir . "/personal/"), array($userGroupID => "W"));
}
COption::SetOptionString("eshop", "wizard_installed", "Y", false, WIZARD_SITE_ID);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:step2.php

示例2: substr

         if ($rcode == "ER") {
             $errorMessage .= substr($responseBody, 2) . "<br />";
         } elseif ($rcode != "OK") {
             $errorMessage .= GetMessage("SPTEN_SCRM_ERR_ANSWER") . "<br />";
         } else {
             $crmUrl4Import = trim(substr($responseBody, 2));
         }
     }
 }
 if (empty($errorMessage)) {
     if ($createNewSaleUser) {
         $APPLICATION->SetGroupRight("sale", $groupId, "W", false);
         //$APPLICATION->SetGroupRight("catalog", $groupId, "R", false);
         CGroup::SetModulePermission($groupId, "catalog", CTask::GetIdByLetter("R", "catalog"));
         //$APPLICATION->SetGroupRight("main", $groupId, "R", false);
         CGroup::SetModulePermission($groupId, "main", CTask::GetIdByLetter("R", "main"));
         $opt = COption::GetOptionString("sale", "1C_SALE_GROUP_PERMISSIONS", "");
         $opt .= ($opt != "" ? "," : "") . $groupId;
         COption::SetOptionString("sale", "1C_SALE_GROUP_PERMISSIONS", $opt);
         function GetAccessArrTmp()
         {
             $PERM = array();
             @(include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/.access.php");
             return $PERM;
         }
         $arFPermsTmp = GetAccessArrTmp();
         $arFPerms = array_key_exists("admin", $arFPermsTmp) ? $arFPermsTmp["admin"] : array();
         $arFPerms[$groupId . ""] = "R";
         $APPLICATION->SetFileAccessPermission(array(SITE_ID, "/bitrix/admin"), $arFPerms);
     }
     LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANGUAGE_ID . "&success=Y&crm_imp_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort . $crmUrl4Import) . "&crm_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:crm.php

示例3: RestoreSecurity

 function RestoreSecurity($arExcludeGroups = array())
 {
     $arBackup = CControllerClient::GetBackup();
     if (!is_array($arBackup)) {
         return true;
     }
     if (is_array($arBackup["security"])) {
         foreach ($arBackup["security"] as $group_code => $perms) {
             if (in_array($group_code, $arExcludeGroups)) {
                 continue;
             }
             if (($group_id = CGroup::GetIDByCode($group_code)) > 0) {
                 foreach ($perms as $module_id => $level) {
                     CGroup::SetModulePermission($group_id, $module_id, $level);
                 }
                 if (isset($arBackup["security_subord_groups"][$group_code])) {
                     CGroup::SetSubordinateGroups($group_id, $arBackup["security_subord_groups"][$group_code]);
                 }
             }
             unset($arBackup["security"][$group_code]);
             unset($arBackup["security_subord_groups"][$group_code]);
         }
         if (count($arBackup["security"]) <= 0) {
             unset($arBackup["security"]);
         }
         CControllerClient::SetBackup($arBackup);
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:29,代码来源:controller_member.php


注:本文中的CGroup::SetModulePermission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。