Skip to content

Commit

Permalink
fix: crashing presentation app with NDE pods (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
lem-onade authored Jan 20, 2022
1 parent 6fc1cf1 commit 0f2835f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/solid-crs-manage/lib/app.services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('Authorization Services', () => {
(sdk.overwriteFile as unknown) = jest.fn(async () => true);

await expect(createPod(solidService)).resolves.toEqual(solidService.getDefaultSession().info.webId);
expect(sdk.overwriteFile).toHaveBeenCalledTimes(1);
expect(sdk.overwriteFile).toHaveBeenCalledTimes(2);

});

Expand Down
19 changes: 19 additions & 0 deletions packages/solid-crs-manage/lib/app.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ export const createPod = async (solidService: SolidSDKService): Promise<string>
a solid:ListedDocument.`,
], { type: 'text/turtle' }), { fetch: session.fetch });

await overwriteFile(`${podBaseUrl}settings/publicTypeIndex.acl`, new Blob([
`@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
# The directory is readable by the public.
<#public>
a acl:Authorization;
acl:agentClass foaf:Agent;
acl:accessTo <./publicTypeIndex>;
acl:mode acl:Read.
# The owner has full access to the entire directory.
<#owner>
a acl:Authorization;
acl:agent <${session?.info?.webId}>;
acl:accessTo <./publicTypeIndex>;
acl:mode acl:Read, acl:Write, acl:Control.`,
], { type: 'text/turtle' }), { fetch: session.fetch });

}

});
Expand Down

0 comments on commit 0f2835f

Please sign in to comment.