本文整理汇总了PHP中Security::hasPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP Security::hasPermission方法的具体用法?PHP Security::hasPermission怎么用?PHP Security::hasPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Security
的用法示例。
在下文中一共展示了Security::hasPermission方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ini_set
<?php
ini_set('display_errors', 'On');
spl_autoload_register(function ($className) {
// Normal PHP path
$path = $_SERVER['DOCUMENT_ROOT'] . "/php/" . $className . ".php";
if (file_exists($path)) {
/** @noinspection PhpIncludeInspection */
include_once $path;
}
});
if (!Security::hasPermission()) {
echo ":(";
die;
}
SQL::getConnection();
示例2: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
if ($networks = Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_NETWORK_CONFIG'))) {
foreach ($networks as $networkId => $network) {
$items[] = array('path' => 'network/network_' . $networkId . 'edit', 'title' => sprintf(_("Edit %s"), $network->getName()), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Network&action=edit&object_id={$networkId}"));
}
}
if (Security::hasPermission(Permission::P('SERVER_PERM_ADD_NEW_NETWORK'), Server::getServer())) {
$items[] = array('path' => 'network/network_add_new', 'title' => sprintf(_("Add a new network on this server")), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Network&action=new_ui"));
}
$items[] = array('path' => 'network', 'title' => _('Network administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例3: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$server = Server::getServer();
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_ROLES'), $server)) {
$items[] = array('path' => 'server/roles', 'title' => _("User roles"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Role&action=list"));
}
return $items;
}
示例4: processGraphAdminUI
/**
* Process admin interface of this object.
*
* @return void
*
* @access public
*/
public function processGraphAdminUI(&$errMsg, $network = null)
{
$hge_id = $this->getHgeId();
if (is_null($network) || Security::hasPermission(Permission::P('NETWORK_PERM_ALLOW_GROUP_NODE'), $network)) {
$name = "hge_{$hge_id}_graph";
HotspotGraph::processGraphAdminUI($this, $errMsg);
}
}
示例5: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$server = self::getServer();
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_SERVER_CONFIG'), $server)) {
$items[] = array('path' => 'server/admin', 'title' => _("Server configuration"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Server&action=edit&object_id=" . SERVER_ID . ""));
}
$items[] = array('path' => 'server', 'title' => _('Server administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例6: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
$network = Network::getCurrentNetwork();
$server = Server::getServer();
if (Security::hasAnyPermission(array(array(Permission::P('NETWORK_PERM_VIEW_ONLINE_USERS'), $network)))) {
$items[] = array('path' => 'users/online_users', 'title' => _("Online Users"), 'url' => BASE_URL_PATH . "admin/online_users.php");
}
if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_SERVER_CONFIG'), $server)) {
$items[] = array('path' => 'users/import_nocat', 'title' => _("Import NoCat user database"), 'url' => BASE_URL_PATH . "admin/import_user_database.php");
}
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_USER'))) {
$items[] = array('path' => 'users/user_manager', 'title' => _("User manager"), 'url' => BASE_URL_PATH . "admin/user_log.php");
}
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_VIEW_STATISTICS'))) {
$items[] = array('path' => 'users/statistics', 'title' => _("Statistics"), 'url' => BASE_URL_PATH . "admin/stats.php");
}
$items[] = array('path' => 'users', 'title' => _('User administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}
示例7: hookMenu
/** Menu hook function */
public static function hookMenu()
{
$items = array();
if (Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'))) {
$items[] = array('path' => 'node/node_edit', 'title' => _("Edit nodes"), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=list"));
} else {
if ($nodes = Security::getObjectsWithPermission(Permission::P('NODE_PERM_EDIT_CONFIG'))) {
foreach ($nodes as $nodeId => $node) {
$items[] = array('path' => 'node/node_' . $nodeId . 'edit', 'title' => sprintf(_("Edit %s"), $node->getName()), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=edit&object_id={$nodeId}"));
}
}
}
if (Security::hasPermission(Permission::P('NETWORK_PERM_ADD_NODE'))) {
$items[] = array('path' => 'node/node_add_new', 'title' => sprintf(_("Add a new node")), 'url' => BASE_URL_PATH . htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=new_ui"));
}
$items[] = array('path' => 'node', 'title' => _('Node administration'), 'type' => MENU_ITEM_GROUPING);
return $items;
}