本文整理汇总了PHP中Piwik\Piwik::isUserHasSomeViewAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::isUserHasSomeViewAccess方法的具体用法?PHP Piwik::isUserHasSomeViewAccess怎么用?PHP Piwik::isUserHasSomeViewAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Piwik
的用法示例。
在下文中一共展示了Piwik::isUserHasSomeViewAccess方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param string $name The setting's persisted name.
* @param string $title The setting's display name.
* @param null|string $userLogin The user this setting applies to. Will default to the current user login.
*/
public function __construct($name, $title, $userLogin = null)
{
parent::__construct($name, $title);
$this->setUserLogin($userLogin);
$this->writableByCurrentUser = Piwik::isUserHasSomeViewAccess();
$this->readableByCurrentUser = Piwik::isUserHasSomeViewAccess();
}
示例2: isWritableByCurrentUser
/**
* Returns `true` if this setting can be displayed for the current user, `false` if otherwise.
*
* @return bool
*/
public function isWritableByCurrentUser()
{
if (isset($this->hasReadAndWritePermission)) {
return $this->hasReadAndWritePermission;
}
$this->hasReadAndWritePermission = Piwik::isUserHasSomeViewAccess();
return $this->hasReadAndWritePermission;
}
示例3: isWritableByCurrentUser
/**
* Returns `true` if this setting can be displayed for the current user, `false` if otherwise.
*
* @return bool
*/
public function isWritableByCurrentUser()
{
if (isset($this->hasWritePermission)) {
return $this->hasWritePermission;
}
// performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB.
$this->hasWritePermission = Piwik::isUserHasSomeViewAccess();
return $this->hasWritePermission;
}
示例4: setBasicVariablesView
/**
* Assigns a set of generally useful variables to a {@link Piwik\View} instance.
*
* The following variables assigned:
*
* **enableMeasurePiwikForSiteId** - The value of the `[Debug] enable_measure_piwik_usage_in_idsite`
* INI config option.
* **isSuperUser** - True if the current user is the Super User, false if otherwise.
* **hasSomeAdminAccess** - True if the current user has admin access to at least one site,
* false if otherwise.
* **isCustomLogo** - The value of the `branding_use_custom_logo` option.
* **logoHeader** - The header logo URL to use.
* **logoLarge** - The large logo URL to use.
* **logoSVG** - The SVG logo URL to use.
* **hasSVGLogo** - True if there is a SVG logo, false if otherwise.
* **enableFrames** - The value of the `[General] enable_framed_pages` INI config option. If
* true, {@link Piwik\View::setXFrameOptions()} is called on the view.
*
* Also calls {@link setHostValidationVariablesView()}.
*
* @param View $view
* @api
*/
protected function setBasicVariablesView($view)
{
$view->clientSideConfig = PiwikConfig::getInstance()->getClientSideOptions();
$view->enableMeasurePiwikForSiteId = PiwikConfig::getInstance()->Debug['enable_measure_piwik_usage_in_idsite'];
$view->isSuperUser = Access::getInstance()->hasSuperUserAccess();
$view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
$view->hasSomeViewAccess = Piwik::isUserHasSomeViewAccess();
$view->isUserIsAnonymous = Piwik::isUserIsAnonymous();
$view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess();
$this->addCustomLogoInfo($view);
$view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl();
$view->logoLarge = \Piwik\Plugins\API\API::getInstance()->getLogoUrl();
$view->logoSVG = \Piwik\Plugins\API\API::getInstance()->getSVGLogoUrl();
$view->hasSVGLogo = \Piwik\Plugins\API\API::getInstance()->hasSVGLogo();
$view->superUserEmails = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
$general = PiwikConfig::getInstance()->General;
$view->enableFrames = $general['enable_framed_pages'] || isset($general['enable_framed_logins']) && $general['enable_framed_logins'];
if (!$view->enableFrames) {
$view->setXFrameOptions('sameorigin');
}
self::setHostValidationVariablesView($view);
}
示例5: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUsers', array('module' => 'UsersManager', 'action' => 'index'), Piwik::isUserHasSomeAdminAccess(), $order = 2);
$menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUserSettings', array('module' => 'UsersManager', 'action' => 'userSettings'), Piwik::isUserHasSomeViewAccess(), $order = 3);
}
示例6: __construct
/**
* Constructor.
*
* @param string $name The persisted name of the setting.
* @param string $title The display name of the setting.
*/
public function __construct($name, $title)
{
parent::__construct($name, $title);
$this->writableByCurrentUser = Piwik::isUserHasSomeAdminAccess();
$this->readableByCurrentUser = Piwik::isUserHasSomeViewAccess();
}
示例7: __construct
/**
* Constructor.
*
* @param string $name The setting's persisted name.
* @param string $title The setting's display name.
* @param null|string $userLogin The user this setting applies to. Will default to the current user login.
*/
public function __construct($name, $title, $userLogin = null)
{
parent::__construct($name, $title);
$this->setUserLogin($userLogin);
$this->displayedForCurrentUser = Piwik::isUserHasSomeViewAccess();
}
示例8: addMenu
/**
* Add admin menu items
*/
function addMenu()
{
MenuAdmin::getInstance()->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUsers', array('module' => 'UsersManager', 'action' => 'index'), Piwik::isUserHasSomeAdminAccess(), $order = 2);
MenuAdmin::getInstance()->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUserSettings', array('module' => 'UsersManager', 'action' => 'userSettings'), Piwik::isUserHasSomeViewAccess(), $order = 3);
}