本文整理汇总了PHP中ACLRole::getRoleActions方法的典型用法代码示例。如果您正苦于以下问题:PHP ACLRole::getRoleActions方法的具体用法?PHP ACLRole::getRoleActions怎么用?PHP ACLRole::getRoleActions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACLRole
的用法示例。
在下文中一共展示了ACLRole::getRoleActions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testgetRoleActions
public function testgetRoleActions()
{
$aclRole = new ACLRole();
//test with empty value
$result = $aclRole->getRoleActions('');
$this->assertTrue(is_array($result));
$this->assertEquals(53, count($result));
//test with non empty but non existing role id value, initially no roles exist.
$result = $aclRole->getRoleActions('1');
$this->assertTrue(is_array($result));
$this->assertEquals(53, count($result));
}
示例2: ACLRole
$role = new ACLRole();
$role_name = '';
$return = array('module' => 'ACLRoles', 'action' => 'index', 'record' => '');
if (!empty($_REQUEST['record'])) {
$role->retrieve($_REQUEST['record']);
$categories = ACLRole::getRoleActions($_REQUEST['record']);
$role_name = $role->name;
if (!empty($_REQUEST['isDuplicate'])) {
//role id is stripped here in duplicate so anything using role id after this will not have it
$role->id = '';
} else {
$return['record'] = $role->id;
$return['action'] = 'DetailView';
}
} else {
$categories = ACLRole::getRoleActions('');
}
$sugar_smarty->assign('ROLE', $role->toArray());
$tdwidth = 10;
if (isset($_REQUEST['return_module'])) {
$return['module'] = $_REQUEST['return_module'];
if (isset($_REQUEST['return_action'])) {
$return['action'] = $_REQUEST['return_action'];
}
if (isset($_REQUEST['return_record'])) {
$return['record'] = $_REQUEST['return_record'];
}
}
$sugar_smarty->assign('RETURN', $return);
$names = ACLAction::setupCategoriesMatrix($categories);
if (!empty($names)) {
示例3: Sugar_Smarty
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
//nsingh bug: 21669. Messes up localization
/*foreach($modInvisList as $modinvisname){
if(empty($app_list_strings['moduleList'][$modinvisname])){
$app_list_strings['moduleList'][$modinvisname] = $modinvisname;
}
}*/
$sugar_smarty->assign('APP_LIST', $app_list_strings);
/*foreach($modInvisList as $modinvisname){
unset($app_list_strings['moduleList'][$modinvisname]);
}*/
$role = new ACLRole();
$role->retrieve($_REQUEST['record']);
$categories = ACLRole::getRoleActions($_REQUEST['record']);
$names = ACLAction::setupCategoriesMatrix($categories);
$categories2 = array();
$categories2 = $categories;
$hidden_categories = array("KBDocuments", "Campaigns", "Forecasts", "ForecastSchedule", "Emails", "EmailTemplates", "EmailMarketing", "Reports");
foreach ($hidden_categories as $v) {
if (isset($categories2[$v])) {
unset($categories2[$v]);
}
}
if (!empty($names)) {
$tdwidth = 100 / sizeof($names);
}
$sugar_smarty->assign('ROLE', $role->toArray());
//xye customization begin
$sugar_smarty->assign("CHECKED", $role->enablesoftphone ? "checked" : "");
示例4: ACLRole
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$role = new ACLRole();
if (isset($_REQUEST['record'])) {
$role->id = $_POST['record'];
}
if (!empty($_REQUEST['name'])) {
$role->name = $_POST['name'];
$role->description = $_POST['description'];
$role->save();
//if duplicate
if (isset($_REQUEST['isduplicate']) && !empty($_REQUEST['isduplicate'])) {
//duplicate actions
$role_actions = $role->getRoleActions($_REQUEST['isduplicate']);
foreach ($role_actions as $module) {
foreach ($module as $type) {
foreach ($type as $act) {
$role->setAction($role->id, $act['id'], $act['aclaccess']);
}
}
}
}
} else {
ob_clean();
$flc_module = 'All';
foreach ($_POST as $name => $value) {
if (substr_count($name, 'act_guid') > 0) {
$name = str_replace('act_guid', '', $name);
$role->setAction($role->id, $name, $value);
示例5: foreach
$aclrole->setAction($aclrole->id, $action_results['Contacts']['delete']['id'], ACL_ALLOW_ALL);
$action_results = ACLAction::getUserActions('will_id', true);
echo 'Actions Peon role for will<br>';
foreach ($action_results as $category_name => $category) {
foreach ($category as $action_name => $action) {
_pp($category_name . ':' . $action_name . ':' . acl_translate($action['access']));
}
}
echo 'Will is a bad peon user<br>';
echo 'Create a role for Bad Peon Users<br>';
$aclrole = new ACLRole();
$aclrole->name = 'Bad Peon User';
$aclrole->description = 'The Bad Peon Role For All Bad Peons';
$aclrole->user_id = 'will_id';
$aclrole->save();
echo 'No Bad Peon user should have access to contacts <br>';
foreach ($action_results['Contacts'] as $action) {
$aclrole->setAction($aclrole->id, $action['id'], ACL_ALLOW_NONE);
}
$action_results = ACLAction::getUserActions('will_id', true);
echo 'Actions Peon role for will<br>';
foreach ($action_results as $category_name => $category) {
foreach ($category as $action_name => $action) {
_pp($category_name . ':' . $action_name . ':' . acl_translate($action['access']));
}
}
echo 'PRINTING THE ACTIONS for a role <br>';
$role_actions = ACLRole::getRoleActions($aclrole->id);
_pp($role_actions);
echo 'PRINTING THE SESSION CACHE FOR ACL <br>';
_PP($_SESSION['ACL']);