@inrupt/solid-client / acp/acp

Module: acp/acp

Type aliases

WithAccessibleAcr

Ƭ WithAccessibleAcr: WithAcp & { internal_acp: { acr: Exclude<WithAcp["internal_acp"]["acr"], null> } }

Resources that conform to this type have an Access Control Resource attached. See hasAccessibleAcr.

since 1.6.0


WithAcp

Ƭ WithAcp: Object

The Access Control Resource of Resources that conform to this type were attempted to be fetched together with those Resources. This might not have been successful; see hasAccessibleAcr to check.

since 1.6.0

Type declaration

Name

Type

internal_acp

Object

internal_acp.acr

AccessControlResource | null

Functions

getFileWithAccessDatasets

getFileWithAccessDatasets(url, options?): Promise<File & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a File, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the File to fetch.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<File & WithAcp | WithAcl>

A File and either the ACL access data or the ACR access data, if available to the current user.


getFileWithAcr

getFileWithAcr(url, options?): Promise<File & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a file and its associated Access Control Resource (if available to the current user).

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the file to fetch.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<File & WithAcp>

A file and the ACR that applies to it, if available to the authenticated user.

Defined in

src/acp/acp.ts:93


getReferencedPolicyUrlAll

getReferencedPolicyUrlAll(withAcr): UrlString[]

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

To make it easy to fetch all the relevant Access Policy Resources, this function returns all referenced Access Policy Resources referenced in an Access Control Resource. In other words, if Access Controls refer to different Policies in the same Access Policy Resource, this function will only return that Access Policy Resource’s URL once.

since 1.6.0

Parameters

Name

Type

Description

withAcr

WithAccessibleAcr

A Resource with an Access Control Resource attached.

Returns

UrlString[]

List of all unique Access Policy Resources that are referenced in the given Access Control Resource.


getResourceInfoWithAccessDatasets

getResourceInfoWithAccessDatasets(url, options?): Promise<WithServerResourceInfo & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch information about a Resource, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the Resource information about which to fetch.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<WithServerResourceInfo & WithAcp | WithAcl>

Information about a Resource and either the ACL access data or the ACR access data, if available to the current user.


getResourceInfoWithAcr

getResourceInfoWithAcr(url, options?): Promise<WithServerResourceInfo & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Retrieve information about a Resource and its associated Access Control Resource (if available to the current user), without fetching the Resource itself.

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the Resource about which to fetch its information.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<WithServerResourceInfo & WithAcp>

Metadata describing a Resource, and the ACR that applies to it, if available to the authenticated user.


getSolidDatasetWithAccessDatasets

getSolidDatasetWithAccessDatasets(url, options?): Promise<SolidDataset & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a SolidDataset, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the SolidDataset to fetch.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<SolidDataset & WithAcp | WithAcl>

A SolidDataset and either the ACL access data or the ACR access data, if available to the current user.


getSolidDatasetWithAcr

getSolidDatasetWithAcr(url, options?): Promise<SolidDataset & WithServerResourceInfo & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a SolidDataset and its associated Access Control Resource (if available to the current user).

since 1.6.0

Parameters

Name

Type

Description

url

Url | UrlString

URL of the SolidDataset to fetch.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<SolidDataset & WithServerResourceInfo & WithAcp>

A SolidDataset and the ACR that applies to it, if available to the authenticated user.

Defined in

src/acp/acp.ts:64


hasAccessibleAcr

hasAccessibleAcr(resource): resource is WithAccessibleAcr

since 1.6.0

Parameters

Name

Type

Description

resource

WithAcp

Resource of which to check whether it has an Access Control Resource attached.

Returns

resource is WithAccessibleAcr

Boolean representing whether the given Resource has an Access Control Resource attached for use in e.g. getPolicyUrlAll.


saveAcrFor

saveAcrFor<ResourceExt>(resource, options?): Promise<ResourceExt>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Save a Resource’s Access Control Resource.

since 1.6.0

Type parameters

Name

Type

ResourceExt

ResourceExt: WithAccessibleAcr

Parameters

Name

Type

Description

resource

ResourceExt

Resource with an Access Control Resource that should be saved.

options

Partial<typeof internal\_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns

Promise<ResourceExt>