當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SecurityGroup::inheritOne方法代碼示例

本文整理匯總了PHP中SecurityGroup::inheritOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP SecurityGroup::inheritOne方法的具體用法?PHP SecurityGroup::inheritOne怎麽用?PHP SecurityGroup::inheritOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SecurityGroup的用法示例。


在下文中一共展示了SecurityGroup::inheritOne方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SecurityGroup

 function popup_select(&$bean, $event, $arguments)
 {
     global $sugar_config;
     //only process if action is Save (meaning a user has triggered this event and not the portal or automated process)
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true && empty($bean->fetched_row['id']) && $bean->module_dir != "Users") {
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $groupFocus = new SecurityGroup();
         $security_modules = $groupFocus->getSecurityModules();
         //if(in_array($bean->module_dir,$security_modules)) {
         if (in_array($bean->module_dir, array_keys($security_modules))) {
             //check if user is in more than 1 group. If so then set the session var otherwise inherit it's only group
             global $current_user;
             $memberships = $groupFocus->getMembershipCount($current_user->id);
             if ($memberships > 1) {
                 $_REQUEST['return_module'] = $bean->module_dir;
                 $_REQUEST['return_action'] = "DetailView";
                 $_REQUEST['return_id'] = $bean->id;
                 $_SESSION['securitygroups_popup_' . $bean->module_dir] = $bean->id;
             } else {
                 if ($memberships == 1) {
                     $groupFocus->inheritOne($current_user->id, $bean->id, $bean->module_dir);
                 }
             }
         }
     }
     if (isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" && $_REQUEST['action'] != 'SaveSignature') {
         //Bug: 589
         $_REQUEST['return_module'] = $bean->module_dir;
         $_REQUEST['return_action'] = "DetailView";
         $_REQUEST['return_id'] = $bean->id;
         $_SESSION['securitygroups_popup_' . $bean->module_dir] = $bean->id;
     }
 }
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:33,代碼來源:AssignGroups.php

示例2: testinheritOne

 public function testinheritOne()
 {
     //unset and reconnect Db to resolve mysqli fetch exeception
     global $db;
     unset($db->database);
     $db->checkConnection();
     $securityGroup = new SecurityGroup();
     $result = $securityGroup->inheritOne(1, 1, 'Accounts');
     $this->assertEquals(false, $result);
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:10,代碼來源:SecurityGroupTest.php


注:本文中的SecurityGroup::inheritOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。