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

Commit

Permalink
Merge pull request #112 from inrupt/fix/permissions-notifications
Browse files Browse the repository at this point in the history
Fixed notification permissions when inbox is created
  • Loading branch information
james-martin-jd authored Jul 31, 2019
2 parents f91f0fb + 5f38c0c commit 61fc46e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/classes/access-control-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ export default class AccessControlList {
createQuadList = (modes: Array<String>, agents: Array<String> | null) => {
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(this.documentUri))
this.createQuad(subject, `${acl}accessTo`, namedNode(documentUri)),
this.createQuad(subject, `${acl}defaultForNew`, namedNode(documentUri))
];
let predicates = [];
if (agents) {
Expand Down Expand Up @@ -244,7 +246,9 @@ export default class AccessControlList {
const { acl, foaf, a } = ACL_PREFIXES;
const subject = `${this.aclUri}#${modes.join('')}`;
await ldflex[subject][a].add(namedNode(`${acl}Authorization`));
await ldflex[subject]['acl:accessTo'].add(namedNode(this.documentUri));
const path = namedNode(this.documentUri);
await ldflex[subject]['acl:accessTo'].add(path);
await ldflex[subject]['acl:defaultForNew'].add(path);
/* If agents is null then it will be added to the default permission (acl:agentClass) for 'everyone' */
if (agents) {
for await (const agent of agents) {
Expand Down

0 comments on commit 61fc46e

Please sign in to comment.