Alter a database user and/or their permissions.

        :param permissions: A ``(readFrom, writeTo)`` tuple
        :raise TypeError: if permissions cannot be read.
        :raise ValueError: if neither password nor permissions provided.

def alter_database_user(self, username, password=None, permissions=None):
        """Alter a database user and/or their permissions.

        :param permissions: A ``(readFrom, writeTo)`` tuple
        :raise TypeError: if permissions cannot be read.
        :raise ValueError: if neither password nor permissions provided.
        """
        url = "db/{0}/users/{1}".format(self._database, username)

        if not password and not permissions:
            raise ValueError("Nothing to alter for user {0}.".format(username))

        data = {}

        if password:
            data['password'] = password

        if permissions:
            try:
                data['readFrom'], data['writeTo'] = permissions
            except (ValueError, TypeError):
                raise TypeError(
                    "'permissions' must be (readFrom, writeTo) tuple"
                )

        self.request(
            url=url,
            method='POST',
            data=data,
            expected_response_code=200
        )

        if username == self._username:
            self._password = password

        return True