public static function hasTheUserSuperUserAccess($theUser)
    {
        if (empty($theUser)) {
            return false;
        }

        if (Piwik::getCurrentUserLogin() === $theUser && Piwik::hasUserSuperUserAccess()) {
            return true;
        }

        try {
            $superUsers = APIUsersManager::getInstance()->getUsersHavingSuperUserAccess();
        } catch (\Exception $e) {
            return false;
        }

        foreach ($superUsers as $superUser) {
            if ($theUser === $superUser['login']) {
                return true;
            }
        }

        return false;
    }
public static function hasTheUserSuperUserAccess($theUser)
    {
        if (empty($theUser)) {
            return false;
        }

        if (Piwik::getCurrentUserLogin() === $theUser && Piwik::hasUserSuperUserAccess()) {
            return true;
        }

        try {
            $superUsers = APIUsersManager::getInstance()->getUsersHavingSuperUserAccess();
        } catch (\Exception $e) {
            return false;
        }

        foreach ($superUsers as $superUser) {
            if ($theUser === $superUser['login']) {
                return true;
            }
        }

        return false;
    }
public static function hasTheUserSuperUserAccess ( $ theUser ) { if ( empty ( $ theUser ) ) { return false ; } if ( Piwik :: getCurrentUserLogin ( ) === $ theUser && Piwik :: hasUserSuperUserAccess ( ) ) { return true ; } try { $ superUsers = APIUsersManager :: getInstance ( ) -> getUsersHavingSuperUserAccess ( ) ; } catch ( \ Exception $ e ) { return false ; } foreach ( $ superUsers as $ superUser ) { if ( $ theUser === $ superUser [ 'login' ] ) { return true ; } } return false ; }
Check whether the given user has superuser access.

@param string $theUser A username.
@return bool
@api
Check whether the given user has superuser access .