MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / isOwner

Method isOwner

lib/ldp.mjs:431–442  ·  view source on GitHub ↗
(webId, hostname)

Source from the content-addressed store, hash-verified

429 // this /.meta has no functionality in actual NSS
430 // comment https://github.com/solid/node-solid-server/pull/1604#discussion_r652903546
431 async isOwner (webId, hostname) {
432 const rootUrl = this.resourceMapper.resolveUrl(hostname)
433 let graph
434 try {
435 graph = await this.getGraph(rootUrl + '/.meta')
436 const SOLID = $rdf.Namespace('http://www.w3.org/ns/solid/terms#')
437 const owner = await graph.statementsMatching($rdf.sym(webId), SOLID('account'), $rdf.sym(rootUrl + '/'))
438 return owner.length
439 } catch (error) {
440 throw new Error(`Failed to get owner from ${rootUrl}/.meta, got ` + error)
441 }
442 }
443
444 async get (options, searchIndex = true) {
445 let pathLocal, contentType, stats

Callers 4

addPermissionsFunction · 0.80
checkPermissionFunction · 0.80
allowFunction · 0.80
ldp-test.mjsFile · 0.80

Calls 2

getGraphMethod · 0.95
resolveUrlMethod · 0.80

Tested by

no test coverage detected