当前位置: 首页>>代码示例>>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;未经允许,请勿转载。