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


PHP Role::retrieve方法代码示例

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


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

示例1: action_roles

 public function action_roles($id = false)
 {
     $toret = new stdClass();
     if ($id) {
         $toret->role = Role::retrieve($id, 'dbobject');
         if ($toret->role) {
             $query = new SelectQuery('Permission');
             $query->filter('`role` = :role');
             $toret->permissions = $query->fetchAll(array(':role' => $toret->role->array['name']));
             $query = new SelectQuery('Assignment');
             $query->leftJoin('BackendUser', array('`backend_users`.`id` = `assignments`.`access_id`'))->filter("`assignments`.`access_type` = 'users'")->filter('`role_id` = :role OR `role_id` = 0');
             $toret->assignments = $query->fetchAll(array(':role' => $toret->role->array['id']));
         } else {
             $toret->permissions = null;
         }
     } else {
         $toret->roles = Role::retrieve();
     }
     return $toret;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:20,代码来源:GateManager.obj.php

示例2: assign

 public static function assign($role_id, $access_type, $access_id)
 {
     $result = false;
     //if (!self::barredRole($role)) {
     if (!is_numeric($role_id)) {
         $role_id = Role::retrieve($role_id);
         $role_id = $role_id['id'];
     }
     $params = array(':role_id' => $role_id, ':access_type' => $access_type, ':access_id' => $access_id);
     $query = new SelectQuery('Assignment');
     $query->filter('`role_id`= :role_id')->filter('`access_type` = :access_type')->filter('`access_id` = :access_id');
     $id = $query->fetchColumn($params);
     if ($id) {
         $result = true;
     } else {
         $keys = array('role_id', 'access_type', 'access_id');
         $data = array_combine($keys, array_values($params));
         $query = new InsertQuery('Assignment');
         $query->data($data);
         $result = $query->execute() ? true : false;
     }
     //}
     return $result;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:24,代码来源:GateKeeper.obj.php

示例3: Role

 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * 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".
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
$focus = new Role();
$focus->retrieve($_REQUEST['record']);
$focus->set_user_relationship($focus->id, $_REQUEST['mass']);
$header_URL = $sugar_config["site_url"] . "/index.php?action=PopupUsers&form=UsersForm&module=Users&record={$_REQUEST['record']}";
$GLOBALS['log']->debug("about to post header URL of: {$header_URL}");
echo "<script language=javascript>\n";
echo "<!-- //\n";
echo "  window.opener.location.reload();\n";
echo "\twindow.location=\"{$header_URL}\";\n";
echo "// -->\n";
echo "</script>";
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:31,代码来源:SaveUserRelationship.php

示例4: Role

 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 ********************************************************************************/
require_once 'modules/Roles/Role.php';
require_once 'include/utils.php';
$focus = new Role();
$tabs_def = urldecode($_REQUEST['display_tabs_def']);
$tabs_hide = urldecode($_REQUEST['hide_tabs_def']);
$allow_modules = explode(':::', $tabs_def);
$disallow_modules = explode(':::', $tabs_hide);
$focus->retrieve($_POST['record']);
print_r($_POST);
unset($_POST['id']);
foreach ($focus->column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        $focus->{$field} = $value;
    }
}
$check_notify = FALSE;
$focus->save($check_notify);
$return_id = $focus->id;
$focus->clear_module_relationship($return_id);
$focus->set_module_relationship($return_id, $allow_modules, 1);
$focus->set_module_relationship($return_id, $disallow_modules, 0);
if (isset($_POST['return_module']) && $_POST['return_module'] != "") {
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Save.php

示例5: html_roles

 public function html_roles($userRoles)
 {
     Backend::add('Sub Title', 'User Roles');
     $vars = array('user_id' => Controller::$parameters[0], 'user_roles' => $userRoles, 'system_roles' => Role::retrieve(false, 'list'));
     Backend::addContent(Render::file('backend_user.roles.tpl.php', $vars));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:6,代码来源:BackendUser.obj.php


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