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


PHP UserRole::setTags方法代码示例

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


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

示例1: copyToPartner

 /**
  * Copy current role to the given partner.
  * @param int $partnerId
  */
 public function copyToPartner($partnerId)
 {
     $newRole = new UserRole();
     $newRole->setName($this->getName());
     $newRole->setDescription($this->getDescription());
     $newRole->setStatus($this->getStatus());
     $newRole->setPermissionNames(parent::getPermissionNames());
     $newRole->setCustomData($this->getCustomData());
     $newRole->setPartnerId($partnerId);
     // set new partner id
     $newRole->setTags($this->getTags());
     return $newRole;
 }
开发者ID:AdiTal,项目名称:server,代码行数:17,代码来源:UserRole.php

示例2: UserRole

$userRoles[] = $role;
$role = new UserRole();
$role->setName('Content Moderator');
$role->setDescription('Access to publisher content moderation panel');
$moderatorPermissions = 'KMC_ACCESS,KMC_READ_ONLY,CONTENT_MODERATE_APPROVE_REJECT,CONTENT_MODERATE_BASE,CONTENT_MODERATE_METADATA,CONTENT_MODERATE_CUSTOM_DATA';
$role->setPermissionNames($moderatorPermissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('kmc');
$role->setPartnerId(99);
$userRoles[] = $role;
$role = new UserRole();
$role->setName('Player Designer');
$role->setDescription('Access to publisher studio');
$designerPermissions = 'KMC_ACCESS,KMC_READ_ONLY,STUDIO_BASE,STUDIO_ADD_UICONF,STUDIO_UPDATE_UICONF,STUDIO_DELETE_UICONF,STUDIO_BRAND_UICONF';
$role->setPermissionNames($designerPermissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('kmc');
$role->setPartnerId(99);
$userRoles[] = $role;
//------------------------------------------------------
foreach ($userRoles as $newRole) {
    if ($dryRun) {
        KalturaLog::log('DRY RUN - Adding new role - ' . print_r($newRole, true));
    } else {
        KalturaLog::log('Adding new role - ' . print_r($newRole, true));
        $newRole->save();
    }
}
$msg = 'Done - ' . ($dryRun ? 'DRY RUN!' : 'REAL RUN!');
KalturaLog::log($msg);
echo $msg;
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:03_create_base_user_roles.php

示例3: UserRole

$userRoles['ps'] = $role;
$role = new UserRole();
$role->setName('Publishers Administrator');
$role->setDescription('Publishers Administrator');
$permissions = 'SYSTEM_ADMIN_BASE,SYSTEM_ADMIN_PUBLISHER_BASE,SYSTEM_ADMIN_PUBLISHER_KMC_ACCESS,SYSTEM_ADMIN_PUBLISHER_CONFIG,SYSTEM_ADMIN_PUBLISHER_BLOCK,SYSTEM_ADMIN_PUBLISHER_ADD,SYSTEM_ADMIN_PUBLISHER_USAGE,SYSTEM_ADMIN_DEVELOPERS_TAB';
$role->setPermissionNames($permissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('admin_console');
$userRoles[] = $role;
$role = new UserRole();
$role->setName('Guest');
$role->setDescription('Guest');
$permissions = 'SYSTEM_ADMIN_BASE';
$role->setPermissionNames($permissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('admin_console');
$userRoles['guest'] = $role;
//------------------------------------------------------
foreach ($userRoles as $key => $newRole) {
    $newRole->setPartnerId(-2);
    // set admin console partner id (-2)
    if ($dryRun) {
        KalturaLog::log('DRY RUN - Adding new role - ' . print_r($newRole, true));
    } else {
        KalturaLog::log('Adding new role - ' . print_r($newRole, true));
        $newRole->save();
        if ($key === 'admin') {
            $partner = PartnerPeer::retrieveByPk(-2);
            $partner->setAdminSessionRoleId($newRole->getId());
            $partner->save();
        }
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:01_create_base_admin_console_roles_and_migrate_users.php


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