Singleton that manages user access to Matomo (formerly Piwik) resources.
To check whether a user has access to a resource, use one of the Piwik::checkUser... methods.
In Matomo there are four different access levels:
Super User access: Only the Super User has this access level. It means the user can do whatever they want.
Super user access is required to set some configuration options. All other options are specific to the user or to a website.
Access is granted per website. Uses with access for a website can view all data associated with that website.
The class defines the following methods:
doAsSuperUser()— Executes a callback with superuser privileges, making sure those privileges are rescinded before this method exits.
Executes a callback with superuser privileges, making sure those privileges are rescinded before this method exits.
Privileges will be rescinded even if an exception is thrown.
It accepts the following parameter(s):
Piwik\callback) — The callback to execute. Should accept no arguments.
The result of
Exception— rethrows any exceptions thrown by