本文整理汇总了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>';
}
}
示例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;
}
示例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);