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


PHP Permission::getDescription方法代码示例

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


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

示例1: showPermissionsList

 /**
  * zobrazi zoznam vsetkych
  * @global array $ALIEN
  */
 public static function showPermissionsList()
 {
     if (!Authorization::getCurrentUser()->hasPermission(38)) {
         new Notification("Prístup zamietnutý.", "error");
         header("Location: ?page=home", false, 301);
         ob_end_flush();
         exit;
     }
     global $ALIEN;
     $ALIEN['HEADER'] = 'Zoznam existujúcich oprávnení';
     $limit = sizeof(Authorization::$Permissions);
     for ($i = 1; $i <= $limit; $i++) {
         $permission = new Permission(Authorization::$Permissions[$i]['label']);
         echo '<div class="item"><img src="images/icons/shield.png"> ID: ' . $permission->getId() . ' | <strong>' . $permission->getLabel() . '</strong> | ' . $permission->getDescription() . '</div>';
     }
 }
开发者ID:dominios,项目名称:alien-framework,代码行数:20,代码来源:Permission.php

示例2: savePermission

 public function savePermission(Permission $inPermission)
 {
     $database = Database::getInstance();
     if (!$database->isConnected()) {
         return false;
     }
     $inName = $database->escapeString(htmlspecialchars(preg_replace('/\\s+/', '', $inPermission->getName())));
     $inHumanName = $database->escapeString(htmlspecialchars(strip_tags($inPermission->getHumanName())));
     $inDescription = $database->escapeString(htmlspecialchars(strip_tags($inPermission->getDescription())));
     if (!$database->updateTable('permission', "permissionName='{$inName}', humanName='{$inHumanName}', permissionDescription='{$inDescription}'", "permissionID={$inPermission->getID()}")) {
         return false;
     }
     return true;
 }
开发者ID:educask,项目名称:EducaskCore,代码行数:14,代码来源:PermissionEngine.php

示例3: Permission

        // live stream
        $allowedLiveStream = $partner->getFromCustomData("liveEnabled", null, 0);
        if ($allowedLiveStream) {
            $livePermission = new Permission();
            $livePermission->setPartnerId($partner->getId());
            $livePermission->setName(PermissionName::FEATURE_LIVE_STREAM);
            $livePermission->setFriendlyName('Live stream feature');
            $livePermission->setDescription('Permission to use live stream');
            $livePermission->setStatus(PermissionStatus::ACTIVE);
            $livePermission->setType(PermissionType::SPECIAL_FEATURE);
            $newPermissions[] = $livePermission;
        }
        if (!$dryRun) {
            foreach ($newPermissions as $permission) {
                KalturaLog::log('SAVING new permission for partner [' . $partner->getId() . ']:');
                PermissionPeer::enableForPartner($permission->getName(), $permission->getType(), $partner->getId(), $permission->getFriendlyName(), $permission->getDescription());
                KalturaLog::log(print_r($permission, true));
            }
        } else {
            foreach ($newPermissions as $permission) {
                KalturaLog::log('DRY RUN ONLY - new permission for partner [' . $partner->getId() . ']:');
                KalturaLog::log(print_r($permission, true));
                // dry run - no saving!
            }
        }
        file_put_contents($lastPartnerFile, $lastPartner);
    }
    $partners = getPartners($lastPartner, $partnerLimitEachLoop);
}
$msg = 'Done - ' . ($dryRun ? 'DRY RUN!' : 'REAL RUN!');
KalturaLog::log($msg);
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:01_set_partner_service_and_plugin_permissions.php


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