Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.
This repository was archived by the owner on May 25, 2021. It is now read-only.

Weird type statement in code #171

Description

@RubenVerborgh

We found the following code (constants/index.js):

export const ACL_PREFIXES = {
  acl: 'http://www.w3.org/ns/auth/acl#',
  foaf: 'http://xmlns.com/foaf/0.1/',
  n: 'http://www.w3.org/2006/vcard/ns#',
  a: 'http://www.w3.org/ns/auth/acl#type'
};

which is used as follows (access-control-list.js):

    const { acl, foaf, a } = ACL_PREFIXES;
    const subject = `${this.aclUri}#${modes.join('')}`;
    const { documentUri } = this;
    const originalPredicates = [
      this.createQuad(subject, `${a}`, namedNode(`${acl}Authorization`)),
      this.createQuad(subject, `${acl}accessTo`, namedNode(documentUri)),
      this.createQuad(subject, `${acl}default`, namedNode(documentUri))
    ];

However, the symbol a in Turtle points to rdf:type or http://www.w3.org/1999/02/22-rdf-syntax-ns#type, not to http://www.w3.org/ns/auth/acl#type.

So the code is creating bogus triples

<> <http://www.w3.org/ns/auth/acl#type> <http://www.w3.org/ns/auth/acl#Authorization>.

The reason it works is because the ACL checker does not need a type statement. But if we add one, we probably want to do it right 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriagedIssue has been triaged and prioritized by the development team.bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions