@inrupt/solid-client-access-grants / common/getters

Module: common/getters#

Classes#

Functions#

getAccessModes#

getAccessModes(vc): AccessModes

Get the access modes granted to a resources via an Access Grant/Request.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

AccessModes

The access modes the grant recipient can exercise.

Example

const modes = getAccessModes(accessGrant);

Defined in#

src/common/getters.ts:363


getInbox#

getInbox(vc): string | undefined

Get the inbox of the requestor of an Access Grant/Request.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

string | undefined

The requestors inbox

Example

const inbox = getInbox(accessGrant);

Defined in#

src/common/getters.ts:342


getInherit#

getInherit(vc): boolean

Check whether a given Access Grant applies recursively to child resources or not.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

boolean

true if the Grant applies to contained resources, false otherwise.

Example

const isInherited = getInherit(accessGrant);

Defined in#

src/common/getters.ts:428


getPurposes#

getPurposes(vc): string[]

Get the purposes for which an Access Grant/Request applies.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

string[]

The purpose IRIs

Example

const purposes = getPurposes(accessGrant);

Defined in#

src/common/getters.ts:194


getRequestor#

getRequestor(vc): string

Get the requestor asking for access to a resources with an Access Grant/Request.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

string

The requestor WebID

Example

const requestorWebId = getRequestor(accessGrant);

Defined in#

src/common/getters.ts:286


getResourceOwner#

getResourceOwner(vc): string

Get the resource owner granting access to their resources from an Access Grant/Request.

Parameters#

Name

Type

Description

vc

AccessGrant

The Access Grant/Request

Returns#

string

The resource owner WebID

Example

const ownerWebId = getResourceOwner(accessGrant);

Defined in#

src/common/getters.ts:258

getResourceOwner(vc): string | undefined

Parameters#

Name

Type

vc

DatasetWithId

Returns#

string | undefined

Defined in#

src/common/getters.ts:259


getResources#

getResources(vc): string[]

Get the resources to which an Access Grant/Request applies.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

string[]

The resources IRIs

Example

const resources = getResources(accessGrant);

Defined in#

src/common/getters.ts:162


getSingleObject#

getSingleObject(vc, subject, predicate, type, required): NamedNode | undefined

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

type

"NamedNode"

required

false

Returns#

NamedNode | undefined

Defined in#

src/common/getters.ts:52

getSingleObject(vc, subject, predicate, type, required): Literal | undefined

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

type

"Literal"

required

false

Returns#

Literal | undefined

Defined in#

src/common/getters.ts:59

getSingleObject(vc, subject, predicate, type): BlankNode

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

type

"BlankNode"

Returns#

BlankNode

Defined in#

src/common/getters.ts:66

getSingleObject(vc, subject, predicate, type): Literal

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

type

"Literal"

Returns#

Literal

Defined in#

src/common/getters.ts:72

getSingleObject(vc, subject, predicate): NamedNode | BlankNode

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

Returns#

NamedNode | BlankNode

Defined in#

src/common/getters.ts:78

getSingleObject(vc, subject, predicate, type, required): NamedNode | BlankNode | undefined

Parameters#

Name

Type

vc

DatasetCore<Quad, Quad>

subject

Term

predicate

Term

type

undefined

required

false

Returns#

NamedNode | BlankNode | undefined

Defined in#

src/common/getters.ts:83


getTypes#

getTypes(vc): string[]

Get the VC types of an Access Grant/Request.

Parameters#

Name

Type

Description

vc

DatasetWithId

The Access Grant/Request

Returns#

string[]

The VC types

Example

const types = getTypes(accessGrant);

Defined in#

src/common/getters.ts:394


isGConsentAccessGrant#

isGConsentAccessGrant(vc): boolean

Parameters#

Name

Type

vc

DatasetWithId

Returns#

boolean

Defined in#

src/common/getters.ts:215