本文整理汇总了PHP中UserRole::setStrId方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRole::setStrId方法的具体用法?PHP UserRole::setStrId怎么用?PHP UserRole::setStrId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRole
的用法示例。
在下文中一共展示了UserRole::setStrId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
}
//------------------------------------------------------
require_once dirname(__FILE__) . '/../../../bootstrap.php';
//------------------------------------------------------
$userRoles = array();
$role = new UserRole();
$role->setName('Basic User Session Role');
$role->setStrId(UserRoleId::BASE_USER_SESSION_ROLE);
$role->setDescription('Allowed actions for a basic user with no special permissions');
$role->setPermissionNames('BASE_USER_SESSION_PERMISSION');
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setPartnerId(0);
$userRoles[] = $role;
$role = new UserRole();
$role->setName('Publisher Administrator');
$role->setStrId(UserRoleId::PARTNER_ADMIN_ROLE);
$role->setDescription('Full control over publisher account and user management functionalities');
$role->setPermissionNames(UserRole::ALL_PARTNER_PERMISSIONS_WILDCARD);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('kmc,partner_admin');
$role->setPartnerId(0);
$userRoles[] = $role;
$role = new UserRole();
$role->setName('Manager');
$role->setDescription('Full control over publisher account functionalities');
$managerPermissions = 'KMC_ACCESS,KMC_READ_ONLY,CONTENT_INGEST_UPLOAD,CONTENT_INGEST_BULK_UPLOAD,CONTENT_INGEST_FEED,CONTENT_MANAGE_DISTRIBUTION_BASE,CONTENT_MANAGE_DISTRIBUTION_WHERE,CONTENT_MANAGE_DISTRIBUTION_SEND,CONTENT_MANAGE_DISTRIBUTION_REMOVE,CONTENT_MANAGE_DISTRIBUTION_PROFILE_MODIFY,CONTENT_MANAGE_VIRUS_SCAN,CONTENT_MANAGE_MIX,CONTENT_MANAGE_BASE,CONTENT_MANAGE_METADATA,CONTENT_MANAGE_ASSIGN_CATEGORIES,CONTENT_MANAGE_THUMBNAIL,CONTENT_MANAGE_SCHEDULE,CONTENT_MANAGE_ACCESS_CONTROL,CONTENT_MANAGE_CUSTOM_DATA,CONTENT_MANAGE_DELETE,CONTENT_MANAGE_RECONVERT,CONTENT_MANAGE_EDIT_CATEGORIES,CONTENT_MANAGE_ANNOTATION,CONTENT_MANAGE_SHARE,CONTENT_MANAGE_DOWNLOAD,LIVE_STREAM_ADD,LIVE_STREAM_UPDATE,CONTENT_MODERATE_BASE,CONTENT_MODERATE_METADATA,CONTENT_MODERATE_CUSTOM_DATA,CONTENT_MODERATE_APPROVE_REJECT,PLAYLIST_BASE,PLAYLIST_ADD,PLAYLIST_UPDATE,PLAYLIST_DELETE,SYNDICATION_BASE,SYNDICATION_ADD,SYNDICATION_UPDATE,SYNDICATION_DELETE,STUDIO_BASE,STUDIO_ADD_UICONF,STUDIO_UPDATE_UICONF,STUDIO_DELETE_UICONF,ACCOUNT_BASE,INTEGRATION_BASE,ACCESS_CONTROL_BASE,ACCESS_CONTROL_ADD,ACCESS_CONTROL_UPDATE,ACCESS_CONTROL_DELETE,TRANSCODING_BASE,TRANSCODING_ADD,TRANSCODING_UPDATE,TRANSCODING_DELETE,CUSTOM_DATA_PROFILE_BASE,CUSTOM_DATA_PROFILE_ADD,CUSTOM_DATA_PROFILE_UPDATE,CUSTOM_DATA_PROFILE_DELETE,CUSTOM_DATA_FIELD_ADD,CUSTOM_DATA_FIELD_UPDATE,CUSTOM_DATA_FIELD_DELETE,ANALYTICS_BASE,WIDGET_ADMIN,SEARCH_SERVICE,ANALYTICS_SEND_DATA,AUDIT_TRAIL_BASE,AUDIT_TRAIL_ADD,ADVERTISING_BASE,ADVERTISING_UPDATE_SETTINGS,PLAYLIST_EMBED_CODE,STUDIO_BRAND_UICONF,STUDIO_SELECT_CONTENT,CONTENT_MANAGE_EMBED_CODE,PLAYLIST_EMBED_CODE';
$role->setPermissionNames($managerPermissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('kmc');
$role->setPartnerId(99);
$userRoles[] = $role;
示例2: isset
<?php
/**
* @package deployment
*
* Create playback-only user role
*
* No need to re-run after server code deploy
*/
chdir(__DIR__);
require_once __DIR__ . '/../../bootstrap.php';
$realRun = isset($argv[1]) && $argv[1] == 'realrun';
KalturaStatement::setDryRun(!$realRun);
$userRole = new UserRole();
$userRole->setStrId('PLAYBACK_BASE_ROLE');
$userRole->setName('PLAYBACK BASE ROLE');
$userRole->setSystemName('PLAYBACK_BASE_ROLE');
$userRole->setDescription('Only playback');
$userRole->setPartnerId(0);
$userRole->setStatus(UserRoleStatus::ACTIVE);
$userRole->setPermissionNames('PLAYBACK_BASE_PERMISSION');
$userRole->save();