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


PHP PermissionPeer类代码示例

本文整理汇总了PHP中PermissionPeer的典型用法代码示例。如果您正苦于以下问题:PHP PermissionPeer类的具体用法?PHP PermissionPeer怎么用?PHP PermissionPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addAction

 /**
  * Add entry
  *
  * @action add
  * @param KalturaMediaEntry $entry
  * @return KalturaMediaEntry
  */
 function addAction(KalturaMediaEntry $entry)
 {
     if ($entry->conversionQuality && !$entry->conversionProfileId) {
         $entry->conversionProfileId = $entry->conversionQuality;
     }
     $dbEntry = parent::add($entry, $entry->conversionProfileId);
     $entryStatus = entryStatus::NO_CONTENT;
     if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_DRAFT_ENTRY_CONV_PROF_SELECTION, $dbEntry->getPartnerId())) {
         $entryConversionProfileHasFlavors = myPartnerUtils::entryConversionProfileHasFlavors($dbEntry->getId());
         if (!$entryConversionProfileHasFlavors) {
             // If the entry's conversion profile dones't contain any flavors, mark the entry as READY
             $entryStatus = entryStatus::READY;
         }
     }
     $dbEntry->setStatus($entryStatus);
     $dbEntry->save();
     $trackEntry = new TrackEntry();
     $trackEntry->setEntryId($dbEntry->getId());
     $trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
     $trackEntry->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA");
     TrackEntry::addTrackEntry($trackEntry);
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry, $dbEntry->getPartnerId(), null, null, null, $dbEntry->getId());
     $entry->fromObject($dbEntry, $this->getResponseProfile());
     return $entry;
 }
开发者ID:AdiTal,项目名称:server,代码行数:32,代码来源:MediaService.php

示例2: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     if ($this->getPartnerId() > 0 && !PermissionPeer::isValidForPartner(PermissionName::FEATURE_LIVE_CHANNEL, $this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:7,代码来源:LiveChannelService.php

示例3: addParseCaptionAssetJob

 /**
  * @param CaptionAsset $captionAsset
  * @param BatchJob $parentJob
  * @throws kCoreException FILE_NOT_FOUND
  * @return BatchJob
  */
 public function addParseCaptionAssetJob(CaptionAsset $captionAsset, BatchJob $parentJob = null)
 {
     $syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
     $fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
     if (!$fileSync) {
         if (!PermissionPeer::isValidForPartner(CaptionPermissionName::IMPORT_REMOTE_CAPTION_FOR_INDEXING, $captionAsset->getPartnerId())) {
             throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
         }
         $fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
         if (!$fileSync) {
             throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
         }
         $fullPath = myContentStorage::getFSUploadsPath() . '/' . $captionAsset->getId() . '.tmp';
         if (!kFile::downloadUrlToFile($fileSync->getExternalUrl($captionAsset->getEntryId()), $fullPath)) {
             throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
         }
         kFileSyncUtils::moveFromFile($fullPath, $syncKey, true, false, true);
     }
     $jobData = new kParseCaptionAssetJobData();
     $jobData->setCaptionAssetId($captionAsset->getId());
     $batchJob = null;
     if ($parentJob) {
         $batchJob = $parentJob->createChild();
     } else {
         $batchJob = new BatchJob();
         $batchJob->setEntryId($captionAsset->getEntryId());
         $batchJob->setPartnerId($captionAsset->getPartnerId());
     }
     return kJobsManager::addJob($batchJob, $jobData, CaptionSearchPlugin::getBatchJobTypeCoreValue(CaptionSearchBatchJobType::PARSE_CAPTION_ASSET));
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:36,代码来源:kCaptionSearchFlowManager.php

示例4: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     $this->applyPartnerFilterForClass('LiveChannelSegment');
     if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_LIVE_CHANNEL, $this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:LiveChannelSegmentService.php

示例5: hasPermissionToCopyToEntry

 /**
  * @param entry $entry
  * @return bool true if cuepoints should be copied to given entry
  */
 public function hasPermissionToCopyToEntry(entry $entry)
 {
     if (!$entry->getIsTemporary() && PermissionPeer::isValidForPartner(AnnotationCuePointPermissionName::COPY_ANNOTATIONS_TO_CLIP, $entry->getPartnerId())) {
         return true;
     }
     if ($entry->getIsTemporary() && !PermissionPeer::isValidForPartner(AnnotationCuePointPermissionName::DO_NOT_COPY_ANNOTATIONS_TO_TRIMMED_ENTRY, $entry->getPartnerId())) {
         return true;
     }
     return false;
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:Annotation.php

示例6: validateForResponseProfile

 public function validateForResponseProfile()
 {
     if (kEntitlementUtils::getEntitlementEnforcement()) {
         if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_ENABLE_RESPONSE_PROFILE_USER_CACHE, kCurrentContext::getCurrentPartnerId())) {
             KalturaResponseProfileCacher::useUserCache();
             return;
         }
         throw new KalturaAPIException(KalturaErrors::CANNOT_LIST_RELATED_ENTITLED_WHEN_ENTITLEMENT_IS_ENABLE, get_class($this));
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:KalturaCategoryFilter.php

示例7: getListResponse

 public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $permissionFilter = $this->toObject();
     $c = new Criteria();
     $permissionFilter->attachToCriteria($c);
     $count = PermissionPeer::doCount($c);
     $pager->attachToCriteria($c);
     $list = PermissionPeer::doSelect($c);
     $response = new KalturaPermissionListResponse();
     $response->objects = KalturaPermissionArray::fromDbArray($list, $responseProfile);
     $response->totalCount = $count;
     return $response;
 }
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:KalturaPermissionFilter.php

示例8: saveIfShouldScan

 private function saveIfShouldScan($flavorAsset)
 {
     if (!PermissionPeer::isAllowedPlugin(VirusScanPlugin::PLUGIN_NAME, $flavorAsset->getPartnerId())) {
         return false;
     }
     if (isset(self::$flavorAssetIdsToScan[$flavorAsset->getId()])) {
         return true;
     }
     $profile = VirusScanProfilePeer::getSuitableProfile($flavorAsset->getEntryId());
     if ($profile) {
         self::$flavorAssetIdsToScan[$flavorAsset->getId()] = $profile;
         return true;
     }
     return false;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:15,代码来源:kVirusScanFlowManager.php

示例9: attachToFinalCriteria

 public function attachToFinalCriteria(Criteria $criteria)
 {
     if (!is_null($this->get('_partner_permissions_exist'))) {
         if (is_null($this->get('_in_id'))) {
             $mandatoryParameter = "_in_id";
             throw new kCoreException("Mandatory parameter {$mandatoryParameter} missing from the filter", kCoreException::MISSING_MANDATORY_PARAMETERS, $mandatoryParameter);
         }
         $permissions = explode(',', $this->get('_partner_permissions_exist'));
         $tmpCriteria = new Criteria();
         $tmpCriteria->addSelectColumn(PermissionPeer::PARTNER_ID);
         $tmpCriteria->addAnd(PermissionPeer::NAME, $permissions, Criteria::IN);
         $ids = explode(',', $this->get('_in_id'));
         $tmpCriteria->addAnd(PermissionPeer::PARTNER_ID, $ids, Criteria::IN);
         $tmpCriteria->addAnd(PermissionPeer::STATUS, PermissionStatus::ACTIVE, Criteria::EQUAL);
         $stmt = PermissionPeer::doSelectStmt($tmpCriteria);
         $this->setIdIn($stmt->fetchAll(PDO::FETCH_COLUMN));
         $this->unsetByName('_partner_permissions_exist');
     }
     return parent::attachToFinalCriteria($criteria);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:20,代码来源:partnerFilter.class.php

示例10: tearDown

 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     UserRolePeer::clearInstancePool();
     PermissionPeer::clearInstancePool();
     PermissionItemPeer::clearInstancePool();
     kuserPeer::clearInstancePool();
     PartnerPeer::clearInstancePool();
     $this->client = null;
     PermissionItemPeer::setUseCriteriaFilter(false);
     foreach ($this->addedPermissionItemIds as $id) {
         try {
             $obj = PermissionItemPeer::retrieveByPK($id);
             if ($obj) {
                 $obj->delete();
             }
         } catch (PropelException $e) {
         }
     }
     PermissionItemPeer::setUseCriteriaFilter(true);
     $this->addedPermissionItemIds = array();
     parent::tearDown();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:25,代码来源:PermissionItemServiceUnitTest.php

示例11: getPermissionNames

 /**
  * Get the [permission_names] column value.
  * If set to self::ALL_PARTNER_PERMISSIONS_WILDCARD (*), return all permisisons relevant for the partner.
  * @var bool $filterDependencies true if should filter permissions which are set for partner but not valid due to dependencies on other permissions which are missing for the partner
  * @return     string
  */
 public function getPermissionNames($filterDependencies = false, $skipTranslateWildcard = false)
 {
     // get from DB
     $permissionNames = parent::getPermissionNames();
     $permissionNames = array_map('trim', explode(',', $permissionNames));
     $currentPartnerId = kCurrentContext::$ks_partner_id;
     if (is_null($currentPartnerId) || $currentPartnerId === '') {
         $currentPartnerId = kCurrentContext::$partner_id;
     }
     // translate * to permission names of all permissions valid for partner
     if (in_array(self::ALL_PARTNER_PERMISSIONS_WILDCARD, $permissionNames) && !$skipTranslateWildcard) {
         $permissionNames = array();
         $permissions = PermissionPeer::getAllValidForPartner($currentPartnerId, $filterDependencies);
         foreach ($permissions as $permission) {
             $permissionNames[$permission->getName()] = $permission->getName();
         }
     }
     $permissionNames = implode(',', $permissionNames);
     if ($filterDependencies) {
         $permissionNames = PermissionPeer::filterDependenciesByNames($permissionNames, $currentPartnerId);
     }
     return $permissionNames;
 }
开发者ID:AdiTal,项目名称:server,代码行数:29,代码来源:UserRole.php

示例12: executeShow

    public function executeShow(sfWebRequest $request)
    {
        $this->role = RolePeer::retrieveByPk($request->getParameter('id'));
        $this->forward404Unless($this->role);
        # get all rights
        $permissions = PermissionPeer::getForSelect();
        # get assigned rights
        $rp_list = RolePermissionPeer::getByRoleId($this->role->getId());
        $assoc_perms = array();
        foreach ($rp_list as $rp) {
            $assoc_perms[] = $rp->getPermissionId();
        }
        $this->assoc_perms = $assoc_perms;
        # prepare widget
        $this->widget = new sfWidgetFormSelectDoubleList(array('choices' => $permissions, 'label_unassociated' => 'Full List', 'label_associated' => 'Rights Assigned to Role', 'class' => 'security', 'associate' => 'lt;', 'unassociate' => 'gt;', 'unassociate_class' => 'btn-left', 'template' => <<<EOF
<div class="%class%" style="padding-top: 0px;">
  <div class="holder">
    <h4>%label_unassociated%</h4>
    %unassociated%
  </div>
  <ul class="btn-switch">
    <li>%associate%</li>
    <li>%unassociate%</li>
  </ul>
  <div class="holder">
    <h4>%label_associated%</h4>
    %associated%
  </div>
    
  <br style="clear: both" />
  <script type="text/javascript">
    sfDoubleList.init(document.getElementById('%id%'), '%class_select%');
  </script>
</div>
EOF
));
    }
开发者ID:yasirgit,项目名称:afids,代码行数:37,代码来源:actions.class.php

示例13: renderEntry

 public function renderEntry($entry)
 {
     if (!$entry instanceof entry) {
         return "";
     }
     $entry_id = $entry->getId();
     $kaltura_elements = "<kaltura:entryId>" . $entry->getId() . "</kaltura:entryId>";
     if (isset(kCurrentContext::$partner_id) && !PermissionPeer::isValidForPartner(PermissionName::FEATURE_HIDE_SENSITIVE_DATA_IN_RSS_FEED, kCurrentContext::$partner_id)) {
         $kaltura_elements .= "<kaltura:views>" . ($entry->getViews() ? $entry->getViews() : "0") . "</kaltura:views>" . "<kaltura:plays>" . ($entry->getPlays() ? $entry->getPlays() : "0") . "</kaltura:plays>" . "<kaltura:userScreenName>" . $entry->getUserScreenName() . "</kaltura:userScreenName>" . "<kaltura:puserId>" . $entry->getPuserId() . "</kaltura:puserId>" . "<kaltura:userLandingPage>" . $entry->getUserLandingPage() . "</kaltura:userLandingPage>";
     } else {
         $kaltura_elements .= "<kaltura:views>0</kaltura:views>" . "<kaltura:plays>0</kaltura:plays>" . "<kaltura:userScreenName></kaltura:userScreenName>" . "<kaltura:puserId></kaltura:puserId>" . "<kaltura:userLandingPage></kaltura:userLandingPage>";
     }
     $kaltura_elements .= "<kaltura:partnerLandingPage>" . $entry->getPartnerLandingPage() . "</kaltura:partnerLandingPage>" . "<kaltura:tags>" . $entry->getTags() . "</kaltura:tags>" . "<kaltura:adminTags>" . $entry->getAdminTags() . "</kaltura:adminTags>" . "<kaltura:votes>" . ($entry->getVotes() ? $entry->getVotes() : "0") . "</kaltura:votes>" . "<kaltura:rank>" . ($entry->getRank() ? $entry->getRank() : "0") . "</kaltura:rank>" . "<kaltura:createdAt>" . $entry->getCreatedAt() . "</kaltura:createdAt>" . "<kaltura:createdAtInt>" . $entry->getCreatedAt(null) . "</kaltura:createdAtInt>" . "<kaltura:sourceLink>" . $entry->getSourceLink() . "</kaltura:sourceLink>" . "<kaltura:credit>" . $entry->getCredit() . "</kaltura:credit>";
     if ($this->type == self::TYPE_TABOOLA) {
         // TODO - use entry->getDisplayScope();
         $taboola_elements = $entry->getDisplayInSearch() >= 2 ? "<tv:label>_KN_</tv:label>" . "<tv:uploader>" . $entry->getPartnerId() . "</tv:uploader>" : '';
     } else {
         $taboola_elements = "";
     }
     // for now the partner_id & entry_id are set in the guid elementy of the item..
     // TODO - move the partner_id to be part of the primary key of the entry so entry will not appear in wrong partners
     $mrss = '<item>' . '<description>Kaltura Item</description>' . '<guid isPermaLink="false">' . $entry->getPartnerId() . "|" . $entry_id . '</guid>' . '<link>' . $entry->getPartnerLandingPage() . '</link>' . '<pubDate>' . $entry->getCreatedAt() . '</pubDate>' . '<media:content ' . 'url="' . $entry->getDataUrl() . '/ext/flv" ' . ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_VIDEO ? 'type="video/x-flv" ' : '  ') . 'medium="' . $entry->getTypeAsString() . '" ' . 'duration="' . (int) ($entry->getLengthInMsecs() / 1000) . '" ' . 'lang="en"' . '/> ' . '<media:title type="plain">' . kString::xmlEncode($entry->getName()) . "</media:title>" . '<media:description>' . kString::xmlEncode($entry->getDescription()) . '</media:description>' . '<media:keywords>' . kString::xmlEncode($entry->getSearchText()) . '</media:keywords>' . '<media:thumbnail url="' . $entry->getThumbnailUrl() . '/width/640/height/480"/>' . '<media:credit role="kaltura partner">' . $entry->getPartnerId() . '</media:credit>' . $kaltura_elements . $taboola_elements . '</item>';
     return $mrss;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:24,代码来源:kalturaRssRenderer.class.php

示例14: enableLogin

 /**
  * Enable user login 
  * @param string $loginId
  * @param string $password
  * @param bool $checkPasswordStructure
  * @throws kUserException::USER_LOGIN_ALREADY_ENABLED
  * @throws kUserException::INVALID_EMAIL
  * @throws kUserException::INVALID_PARTNER
  * @throws kUserException::ADMIN_LOGIN_USERS_QUOTA_EXCEEDED
  * @throws kUserException::PASSWORD_STRUCTURE_INVALID
  * @throws kUserException::LOGIN_ID_ALREADY_USED
  */
 public function enableLogin($loginId, $password = null, $checkPasswordStructure = true, $sendEmail = null)
 {
     if (!$password) {
         $password = UserLoginDataPeer::generateNewPassword();
         if (is_null($sendEmail)) {
             $sendEmail = true;
         }
     }
     if ($this->getLoginDataId()) {
         throw new kUserException('', kUserException::USER_LOGIN_ALREADY_ENABLED);
     }
     $loginDataExisted = null;
     $loginData = UserLoginDataPeer::addLoginData($loginId, $password, $this->getPartnerId(), $this->getFirstName(), $this->getLastName(), $this->getIsAdmin(), $checkPasswordStructure, $loginDataExisted);
     if (!$loginData) {
         throw new kUserException('', kUserException::LOGIN_DATA_NOT_FOUND);
     }
     $this->setLoginDataId($loginData->getId());
     //Email notification on user creation is sent while using kuser email so make sure this field is set before enabling login
     //if not than set the email to be the $loginId provided to this action (we now know this is a valid email since "addLoginData" verifies this)
     if (!$this->getEmail()) {
         $this->setEmail($loginId);
     }
     if ($sendEmail) {
         if ($loginDataExisted) {
             kuserPeer::sendNewUserMail($this, true);
         } else {
             kuserPeer::sendNewUserMail($this, false);
         }
         if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_DISABLE_NEW_USER_EMAIL, $this->getPartnerId())) {
             kuserPeer::sendNewUserMailToAdmins($this);
         }
     }
     return $this;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:46,代码来源:kuser.php

示例15: dirname

 * @subpackage dragonfly.roles_and_permissions
 * 
 * Populate permission table with all base permissions
 * 
 * No need to re-run after server code depoloy
 * In order to re-run delete from permission
 */
$dryRun = true;
//TODO: change for real run
if ($argc > 1 && $argv[1] == 'realrun') {
    $dryRun = false;
}
//------------------------------------------------------
require_once dirname(__FILE__) . '/../../../bootstrap.php';
//------------------------------------------------------
$permissionsData = array(array(-1, PermissionType::NORMAL, PermissionName::BATCH_BASE, 'Batch system permission', null), array(0, PermissionType::NORMAL, PermissionName::USER_SESSION_PERMISSION, 'User session permission', null), array(0, PermissionType::NORMAL, PermissionName::ALWAYS_ALLOWED_ACTIONS, 'No session permission', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_INGEST_UPLOAD, 'Upload', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_INGEST_BULK_UPLOAD, 'Bulk upload', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_INGEST_FEED, 'Feed subscription', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_MIX, 'Manage remix', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_BASE, 'Basic content management', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_METADATA, 'Modify metadata', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_ASSIGN_CATEGORIES, 'Assign categories', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_THUMBNAIL, 'Modify thumbnails', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_SCHEDULE, 'Modify scheduling', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_ACCESS_CONTROL, 'Modify content access control', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_CUSTOM_DATA, 'Modify custom data', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DELETE, 'Delete content', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_RECONVERT, 'Reconvert flavors', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_EDIT_CATEGORIES, 'Manage categories', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_EMBED_CODE, 'Grab embed code', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DISTRIBUTION_BASE, 'Distribution base', PermissionPeer::getPermissionNameFromPluginName(ContentDistributionPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DISTRIBUTION_WHERE, 'Where to distribute', PermissionPeer::getPermissionNameFromPluginName(ContentDistributionPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DISTRIBUTION_SEND, 'Distribution submit', PermissionPeer::getPermissionNameFromPluginName(ContentDistributionPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DISTRIBUTION_REMOVE, 'Distribution remove', PermissionPeer::getPermissionNameFromPluginName(ContentDistributionPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DISTRIBUTION_PROFILE_MODIFY, 'Distribution profile manage', PermissionPeer::getPermissionNameFromPluginName(ContentDistributionPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_VIRUS_SCAN, 'Virus scan actions', PermissionPeer::getPermissionNameFromPluginName(VirusScanPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_DOWNLOAD, 'Content download', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_ANNOTATION, 'Annotate', PermissionPeer::getPermissionNameFromPluginName(AnnotationPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MANAGE_SHARE, 'Share content', null), array(0, PermissionType::NORMAL, PermissionName::LIVE_STREAM_ADD, 'Add live streams', PermissionName::FEATURE_LIVE_STREAM), array(0, PermissionType::NORMAL, PermissionName::LIVE_STREAM_UPDATE, 'Modify live streams', PermissionName::FEATURE_LIVE_STREAM), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MODERATE_BASE, 'Basic moderation', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MODERATE_METADATA, 'Moderate metadata', null), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MODERATE_CUSTOM_DATA, 'Moderate custom data', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CONTENT_MODERATE_APPROVE_REJECT, 'Approve/Reject content', null), array(0, PermissionType::NORMAL, PermissionName::PLAYLIST_BASE, 'Playlist access', null), array(0, PermissionType::NORMAL, PermissionName::PLAYLIST_ADD, 'Add playlists', null), array(0, PermissionType::NORMAL, PermissionName::PLAYLIST_UPDATE, 'Modify playlists', null), array(0, PermissionType::NORMAL, PermissionName::PLAYLIST_DELETE, 'Delete playlists', null), array(0, PermissionType::NORMAL, PermissionName::PLAYLIST_EMBED_CODE, 'Grab playlist embed code', null), array(0, PermissionType::NORMAL, PermissionName::SYNDICATION_BASE, 'Syndication feeds access', null), array(0, PermissionType::NORMAL, PermissionName::SYNDICATION_ADD, 'Create syndication feeds', null), array(0, PermissionType::NORMAL, PermissionName::SYNDICATION_UPDATE, 'Modify syndication feeds', null), array(0, PermissionType::NORMAL, PermissionName::SYNDICATION_DELETE, 'Delete syndication feeds', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_BASE, 'Appstudio access', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_ADD_UICONF, 'Create players', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_UPDATE_UICONF, 'Modify players', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_DELETE_UICONF, 'Delete players', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_BRAND_UICONF, 'Set player branding', null), array(0, PermissionType::NORMAL, PermissionName::STUDIO_SELECT_CONTENT, 'Select player content', null), array(0, PermissionType::NORMAL, PermissionName::ADVERTISING_BASE, 'Advertising access', null), array(0, PermissionType::NORMAL, PermissionName::ADVERTISING_UPDATE_SETTINGS, 'Modify advertising settings', null), array(0, PermissionType::NORMAL, PermissionName::ACCOUNT_BASE, 'Account settings access', null), array(0, PermissionType::NORMAL, PermissionName::ACCOUNT_UPDATE_SETTINGS, 'Modify account settings', null), array(0, PermissionType::NORMAL, PermissionName::INTEGRATION_BASE, 'Integration settings access', null), array(0, PermissionType::NORMAL, PermissionName::INTEGRATION_UPDATE_SETTINGS, 'Modify integration settings', null), array(0, PermissionType::NORMAL, PermissionName::ACCESS_CONTROL_BASE, 'Access control profiles access', null), array(0, PermissionType::NORMAL, PermissionName::ACCESS_CONTROL_ADD, 'Create access control profiles', null), array(0, PermissionType::NORMAL, PermissionName::ACCESS_CONTROL_UPDATE, 'Modify access control profiles', null), array(0, PermissionType::NORMAL, PermissionName::ACCESS_CONTROL_DELETE, 'Delete access control profiles', null), array(0, PermissionType::NORMAL, PermissionName::TRANSCODING_BASE, 'Transcoding profiles access', null), array(0, PermissionType::NORMAL, PermissionName::TRANSCODING_ADD, 'Create transcoding profiles', null), array(0, PermissionType::NORMAL, PermissionName::TRANSCODING_UPDATE, 'Modify transcoding profiles', null), array(0, PermissionType::NORMAL, PermissionName::TRANSCODING_DELETE, 'Delete transcoding profiles', null), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_PROFILE_BASE, 'Custom data access', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_PROFILE_ADD, 'Create custom data', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_PROFILE_UPDATE, 'Modify custom data', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_PROFILE_DELETE, 'Delete custom data', PermissionPeer::getPermissionNameFromPluginName(MetadataPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::ADMIN_BASE, 'Administration settings access', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_USER_ADD, 'Add users', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_USER_UPDATE, 'Modify users', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_USER_DELETE, 'Delete users', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_ROLE_ADD, 'Add roles', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_ROLE_UPDATE, 'Modify roles', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_ROLE_DELETE, 'Delete roles', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_PUBLISHER_MANAGE, 'Manage publishers', null), array(0, PermissionType::NORMAL, PermissionName::ADMIN_WHITE_BRANDING, 'Manage whitebranding', null), array(0, PermissionType::NORMAL, PermissionName::ANALYTICS_BASE, 'Analytics access', PermissionName::FEATURE_ANALYTICS_TAB), array(0, PermissionType::NORMAL, PermissionName::WIDGET_ADMIN, 'Widget admin', null), array(0, PermissionType::NORMAL, PermissionName::ANALYTICS_SEND_DATA, 'Send analytics data', null), array(0, PermissionType::NORMAL, PermissionName::WIDGET_ADMIN, 'Widget admin', null), array(0, PermissionType::NORMAL, PermissionName::SEARCH_SERVICE, 'Search service', null), array(0, PermissionType::NORMAL, PermissionName::ANALYTICS_SEND_DATA, 'Send analytics data', null), array(0, PermissionType::NORMAL, PermissionName::AUDIT_TRAIL_BASE, 'Audit trail base', PermissionPeer::getPermissionNameFromPluginName(AuditPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::AUDIT_TRAIL_ADD, 'Audit trail add', PermissionPeer::getPermissionNameFromPluginName(AuditPlugin::getPluginName())), array(0, PermissionType::NORMAL, PermissionName::KMC_ACCESS, 'KMC access', null), array(0, PermissionType::NORMAL, PermissionName::KMC_READ_ONLY, 'KMC access', PermissionName::KMC_ACCESS), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_FIELD_ADD, 'Add custom data field', null), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_FIELD_UPDATE, 'Update custom data field', null), array(0, PermissionType::NORMAL, PermissionName::CUSTOM_DATA_FIELD_DELETE, 'Delete custom data field', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_BASE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_BASE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_KMC_ACCESS, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_CONFIG, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_BLOCK, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_REMOVE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_ADD, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PUBLISHER_USAGE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_USER_MANAGE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_SYSTEM_MONITOR, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_DEVELOPERS_TAB, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_BATCH_CONTROL, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_BATCH_CONTROL_INPROGRESS, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_BATCH_CONTROL_FAILED, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_BATCH_CONTROL_SETUP, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_STORAGE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_VIRUS_SCAN, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_EMAIL_INGESTION, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_CONTENT_DISTRIBUTION_BASE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_CONTENT_DISTRIBUTION_MODIFY, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_PERMISSIONS_MANAGE, 'Base system admin permission', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_INTERNAL, 'System internal actions', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_ADMIN_ENTRY_INVESTIGATION, 'Entry investigation', null), array(-2, PermissionType::NORMAL, PermissionName::SYSTEM_FILESYNC, 'Filesync actions', null), array(99, PermissionType::SPECIAL_FEATURE, PermissionName::FEATURE_PS2_PERMISSIONS_VALIDATION, 'PS2 permissions validation', null));
//------------------------------------------------------
$allPermissions = array();
foreach ($permissionsData as $data) {
    $permission = new Permission();
    $permission->setPartnerId($data[0]);
    $permission->setType($data[1]);
    $permission->setName($data[2]);
    $permission->setFriendlyName($data[3]);
    $permission->setDependsOnPermissionNames($data[4]);
    $permission->setStatus(PermissionStatus::ACTIVE);
    $allPermissions[] = $permission;
}
//------------------------------------------------------
foreach ($allPermissions as $permission) {
    if ($dryRun) {
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:02_create_base_permissions.php


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