本文整理汇总了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;
}
}
示例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);
}