public function revokeAll(int $mode = WebAclRule::READ): WebAcl {
        WebAclRule::checkMode($mode);

        if ($mode == WebAclRule::WRITE) {
            foreach ($this->resRules as $i) {
                $i->setMode(WebAclRule::READ);
                if (self::$autosave) {
                    $i->save($this->res->getAclUrl());
                }
            }
        } else {
            foreach ($this->resRules as $i) {
                $i->delete(true);
            }
            $this->resRules = array();
        }

        return $this;
    }