userLogin = $userLogin; $factory = StaticContainer::get('Piwik\Settings\Storage\Factory'); $this->storage = $factory->getPluginStorage($this->pluginName, $this->userLogin); } /** * 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; } }