protected function loadMetadata(bool $force = false) {
        $metaEmpty = $this->metadata == null;
        parent::loadMetadata($force);

        if ($metaEmpty || $force) {
            foreach ($this->metadata->allResources('http://www.w3.org/ns/auth/acl#mode') as $i) {
                $mode = preg_replace('#^.*(Read|Write)$#', '\\1', $i->getUri());
                $dict = array('Read' => self::READ, 'Write' => self::WRITE);
                if (!isset($dict[$mode])) {
                    throw new AclException('wrong mode: ' . $mode);
                }
                $this->mode = max(array($this->mode, $dict[$mode]));
            }
            foreach ($this->metadata->allResources('http://www.w3.org/ns/auth/acl#accessTo') as $i) {
                $uri                   = $this->fedora->standardizeUri($i->getUri());
                $this->resources[$uri] = $this->fedora->getResourceByUri($uri);
            }
            foreach ($this->metadata->allResources('http://www.w3.org/ns/auth/acl#accessToClass') as $i) {
                $this->classes[$i->getUri()] = $i->getUri();
            }
            foreach ($this->metadata->all('http://www.w3.org/ns/auth/acl#agent') as $i) {
                $i                           = (string) $i;
                $this->roles[self::USER][$i] = $i;
            }
            foreach ($this->metadata->all('http://www.w3.org/ns/auth/acl#agentClass') as $i) {
                $i                            = (string) $i;
                $this->roles[self::GROUP][$i] = $i;
            }
        }
    }