當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik::isUserHasSomeViewAccess方法代碼示例

本文整理匯總了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();
 }
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:14,代碼來源:UserSetting.php

示例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;
 }
開發者ID:bossrabbit,項目名稱:piwik,代碼行數:13,代碼來源:UserSetting.php

示例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;
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:14,代碼來源:UserSetting.php

示例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);
 }
開發者ID:brienomatty,項目名稱:elmsln,代碼行數:45,代碼來源:Controller.php

示例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);
 }
開發者ID:brienomatty,項目名稱:elmsln,代碼行數:5,代碼來源:Menu.php

示例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();
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:12,代碼來源:MeasurableSetting.php

示例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();
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:13,代碼來源:UserSetting.php

示例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);
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:8,代碼來源:UsersManager.php


注:本文中的Piwik\Piwik::isUserHasSomeViewAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。