@inrupt/solid-client / acp_ess_2

Module: acp_ess_2#

Experimental API

The Access Control Policies proposal has not yet been reviewed for inclusion in the Solid spec. To enable early experimentation, solid-client exposes a low-level API. However, this API can and will include breaking changes in non-major releases. Additionally, for most applications, a higher-level API that is planned will be more applicable.

Thus, the following export is only intended for experimentation by early adopters, and is not recommended for production applications. Because of this, all ACP-related API’s are exported on a single object, which does not facilitate tree-shaking: if you use one ACP-related API, all of them will be included in your bundle.

For more information see: Tutorial: Managing Access

This module supports Inrupt’s ESS 2.0 ACP implementation.

This module can be imported as an object from the main package, which results in tree-shaking not being supported (so all the exported APIs will likely end up in your bundle). This import style is used for environments such as nextjs or create-react-app.

import { acp_ess_2 } from "@inrupt/solid-client";

Functions#

addAcrPolicyUrl#

addAcrPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Add a policy applying to the ACR of the given resource.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to add the URL of a policy applying to its access control resource.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/addAcrPolicyUrl.ts:46


addAgent#

addAgent(matcher, agent): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Apply the [[Matcher]] to an additional agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The [[Matcher]] to be applied to an additional agent.

agent

string

The agent the [[Matcher]] should apply to.

Returns#

Matcher

A copy of the [[Matcher]], applying to an additional agent.

Defined in#

src/acp/matcher.ts:607


addAllOfMatcherUrl#

addAllOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Add a Matcher that refines the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.

Also see [[addAnyOfMatcherUrl]] and [[addNoneOfMatcherUrl]].

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to add to the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the new Matcher added.

Defined in#

src/acp/matcher.ts:84


addAnyOfMatcherUrl#

addAnyOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Add a Matcher that extends the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.

Also see [[addAllOfMatcherUrl]] and [[addNoneOfMatcherUrl]].

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to add to the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the new Matcher added.

Defined in#

src/acp/matcher.ts:163


addClient#

addClient(matcher, client): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Apply the [[Matcher]] to an additional Client.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The [[Matcher]] to be applied to an additional Client.

client

string | Url

The Client the [[Matcher]] should apply to.

Returns#

Matcher

A copy of the [[Matcher]], applying to an additional Client.

Defined in#

src/acp/matcher.ts:850


addMemberAcrPolicyUrl#

addMemberAcrPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Add a policy applying to the ACRs of the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to add the URL of a policy applying to its children’s access control resources.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/addMemberAcrPolicyUrl.ts:46


addMemberPolicyUrl#

addMemberPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Add a policy applying to the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to add the URL of a policy applying to its children.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/addMemberPolicyUrl.ts:46


addMockAcrTo#

addMockAcrTo<T>(resource, accessControlResource?): T & WithAccessibleAcr

Warning

Do not use this function in production code. For use in unit tests that require a Resource with an [[AccessControlResource]].

Attaches an Access Control Resource to a given [[SolidDataset]] for use in unit tests; e.g., unit tests that call [[getPolicyUrlAll]].

Since

1.6.0

Type parameters#

Name

Type

T

extends WithResourceInfo

Parameters#

Name

Type

Description

resource

T

The Resource to mock up with a new resource ACL.

accessControlResource

AccessControlResource

The Access Control Resource to attach to the given Resource.

Returns#

T & WithAccessibleAcr

The input Resource with an empty resource ACL attached.

Defined in#

src/acp/mock.ts:67


addNoneOfMatcherUrl#

addNoneOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Add a Matcher that restricts the scope of a given the [[Policy]]. If an agent requesting access to a resource is matched by another Matcher, but also by the given Matcher, they will not be granted access.

Also see [[addAllOfMatcherUrl]] and [[addAnyOfMatcherUrl]].

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to add to the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the new Matcher added.

Defined in#

src/acp/matcher.ts:242


addPolicyUrl#

addPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Add a policy applying to the given resource.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to add the URL of a policy applying to it.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/addPolicyUrl.ts:46


createMatcher#

createMatcher(url): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Initialise a new, empty [[Matcher]].

Since

Not released yet.

Parameters#

Name

Type

Description

url

string | Url

URL that identifies this [[Matcher]].

Returns#

Matcher

Defined in#

src/acp/matcher.ts:317


createPolicy#

createPolicy(url): Policy

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Initialise a new, empty [[Policy]].

Since

1.6.0

Parameters#

Name

Type

Description

url

string | Url

URL that identifies this Policy.

Returns#

Policy

Defined in#

src/acp/policy.ts:99


createResourceMatcherFor#

createResourceMatcherFor(resourceWithAcr, name): ResourceMatcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Initialise a new, empty [[ResourceMatcher]] for the given Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource to which the new Matcher is to apply.

name

string

Name that identifies this [[Matcher]].

Returns#

ResourceMatcher

Defined in#

src/acp/matcher.ts:335


createResourcePolicyFor#

createResourcePolicyFor(resourceWithAcr, name): ResourcePolicy

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Initialise a new, empty [[ResourcePolicy]] for the given Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource to which the Policy is to apply.

name

string

The name that identifies this Policy.

Returns#

ResourcePolicy

Defined in#

src/acp/policy.ts:438


getAcrPolicyUrlAll#

getAcrPolicyUrlAll<T>(resourceWithAcr): UrlString[]

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Get the URLs of policies applying to the ACR of the given resource.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to retrieve URLs of policies applying to its access control resource.

Returns#

UrlString[]

Policy URL array.

Defined in#

src/acp/policy/getAcrPolicyUrlAll.ts:42


getAgentAll#

getAgentAll(matcher): WebId[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

List all the agents a [[Matcher]] applies directly to. This will not include agents that are matched on a property other than their WebID.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The matcher from which agents are read.

Returns#

WebId[]

A list of the WebIDs of agents included in the matcher.

Defined in#

src/acp/matcher.ts:554


getAllOfMatcherUrlAll#

getAllOfMatcherUrlAll<P>(policy): UrlString[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the “All Of” [[Matcher]]s for the given [[Policy]]

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[policy]] from which the Matchers should be read.

Returns#

UrlString[]

A list of the “All Of” [[Matcher]]s

Defined in#

src/acp/matcher.ts:141


getAllowModes#

getAllowModes<P>(policy): AccessModes

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Given a [[Policy]], return which [[AccessModes]] it allows.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The Policy for which you want to know the Access Modes it allows.

Returns#

AccessModes

Defined in#

src/acp/policy.ts:273


getAnyOfMatcherUrlAll#

getAnyOfMatcherUrlAll<P>(policy): UrlString[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the “Any Of” [[Matcher]]s for the given [[Policy]]

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[policy]] from which the Matchers should be read.

Returns#

UrlString[]

A list of the “Any Of” [[Matcher]]s

Defined in#

src/acp/matcher.ts:220


getClientAll#

getClientAll(matcher): WebId[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

List all the clients a [[Matcher]] applies directly to. This will not include specific client classes, such as public clients.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher from which clients are read.

Returns#

WebId[]

A list of the WebIDs of clients included in the Matcher.

Defined in#

src/acp/matcher.ts:809


getDenyModes#

getDenyModes<P>(policy): AccessModes

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Given a [[Policy]], return which [[AccessModes]] it disallows.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The Policy on which you want to know the Access Modes it disallows.

Returns#

AccessModes

Defined in#

src/acp/policy.ts:391


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

Default value

Description

url

string | Url

undefined

URL of the File to fetch.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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.

Defined in#

src/acp/acp.ts:198


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

Default value

Description

url

string | Url

undefined

URL of the file to fetch.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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:96


getLinkedAcrUrl#

getLinkedAcrUrl<Resource>(resource): UrlString | undefined

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.

Given a Resource, find out the URL of its governing Access Control Resource.

Since

1.15.0

Type parameters#

Name

Type

Resource

extends WithServerResourceInfo

Parameters#

Name

Type

Description

resource

Resource

Resource which should be governed by Access Policies.

Returns#

UrlString | undefined

The URL of the Access Control Resource, or undefined if not ACR is found.

Defined in#

src/acp/acp.ts:451


getMatcher#

getMatcher(matcherResource, url): Matcher | null

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the [[Matcher]] with the given URL from an [[SolidDataset]].

Since

Not released yet.

Parameters#

Name

Type

Description

matcherResource

Readonly<{}>

The Resource that contains the given [[Matcher]].

url

string | Url

URL that identifies this [[Matcher]].

Returns#

Matcher | null

The requested [[Matcher]], if it exists, or null if it does not.

Defined in#

src/acp/matcher.ts:359


getMatcherAll#

getMatcherAll(matcherResource): Matcher[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Gets the [[Matcher]]s from a [[SolidDataset]].

Since

Not released yet.

Parameters#

Name

Type

Description

matcherResource

Readonly<{}>

The Resource that contains (zero or more) [[Matcher]]s.

Returns#

Matcher[]

The [[Matcher]]s contained in this resource.

Defined in#

src/acp/matcher.ts:409


getMemberAcrPolicyUrlAll#

getMemberAcrPolicyUrlAll<T>(resourceWithAcr): UrlString[]

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Get the URLs of policies applying to the ACRs of the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to retrieve URLs of policies applying to its children’s access control resources.

Returns#

UrlString[]

Policy URL array.

Defined in#

src/acp/policy/getMemberAcrPolicyUrlAll.ts:43


getMemberPolicyUrlAll#

getMemberPolicyUrlAll<T>(resourceWithAcr): UrlString[]

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Get the URLs of policies applying to the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to retrieve URLs policies applying to its children.

Returns#

UrlString[]

Policy URL array.

Defined in#

src/acp/policy/getMemberPolicyUrlAll.ts:42


getNoneOfMatcherUrlAll#

getNoneOfMatcherUrlAll<P>(policy): UrlString[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the “None Of” [[Matcher]]s for the given [[Policy]]

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[policy]] from which the Matchers should be read.

Returns#

UrlString[]

A list of the forbidden [[Matcher]]s

Defined in#

src/acp/matcher.ts:301


getPolicy#

getPolicy(policyResource, url): Policy | null

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the [[Policy]] with the given URL from an [[SolidDataset]].

Since

1.6.0

Parameters#

Name

Type

Description

policyResource

Readonly<{}>

The Resource that contains the given Policy.

url

string | Url

URL that identifies this Policy.

Returns#

Policy | null

The requested Policy, if it exists, or null if it does not.

Defined in#

src/acp/policy.ts:119


getPolicyAll#

getPolicyAll(policyResource): Policy[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get all [[Policy]]’s in a given [[SolidDataset]].

Since

1.6.0

Parameters#

Name

Type

Description

policyResource

Readonly<{}>

The Resource that contains Access Policies.

Returns#

Policy[]

Defined in#

src/acp/policy.ts:141


getPolicyUrlAll#

getPolicyUrlAll(resourceWithAcr): UrlString[]

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Get the URLs of policies applying to the given resource.

Since

1.16.1

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The resource for which to retrieve URLs of policies applying to it.

Returns#

UrlString[]

Policy URL array.

Defined in#

src/acp/policy/getPolicyUrlAll.ts:42


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.

Defined in#

src/acp/acp.ts:403


getResourceAcrPolicy#

getResourceAcrPolicy(resourceWithAcr, name): ResourcePolicy | null

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the [[ResourcePolicy]] with the given name that applies to a Resource’s Access Control Resource from that Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose ACR contains the given Policy.

name

string

The name that identifies this Policy.

Returns#

ResourcePolicy | null

The requested Policy, if it exists and applies to the Resource’s ACR, or null if it does not.

Defined in#

src/acp/policy.ts:497


getResourceAcrPolicyAll#

getResourceAcrPolicyAll(resourceWithAcr): ResourcePolicy[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get all [[ResourcePolicy]]’s that apply to a given Resource’s Access Control Resource from that Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains Access Policies.

Returns#

ResourcePolicy[]

Defined in#

src/acp/policy.ts:551


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

Default value

Description

url

string | Url

undefined

URL of the Resource information about which to fetch.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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.

Defined in#

src/acp/acp.ts:236


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

Default value

Description

url

string | Url

undefined

URL of the Resource about which to fetch its information.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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.

Defined in#

src/acp/acp.ts:126


getResourceMatcher#

getResourceMatcher(resourceWithAcr, name): ResourceMatcher | null

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the [[ResourceMatcher]] with the given name from an Resource’s Access Control Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains the given [[ResourceMatcher]].

name

string

Name that identifies this [[ResourceMatcher]].

Returns#

ResourceMatcher | null

The requested [[ResourceMatcher]], if it exists, or null if it does not.

Defined in#

src/acp/matcher.ts:383


getResourceMatcherAll#

getResourceMatcherAll(resourceWithAcr): ResourceMatcher[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Gets the [[ResourceMatcher]]s from a Resource’s Access Control Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains (zero or more) [[ResourceMatcher]]s.

Returns#

ResourceMatcher[]

The [[ResourceMatcher]]s contained in this Resource’s Access Control Resource.

Defined in#

src/acp/matcher.ts:425


getResourcePolicy#

getResourcePolicy(resourceWithAcr, name): ResourcePolicy | null

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get the [[ResourcePolicy]] with the given name that applies to a Resource from its Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose ACR contains the given Policy.

name

string

The name that identifies this Policy.

Returns#

ResourcePolicy | null

The requested Policy, if it exists and applies to the given Resource, or null if it does not.

Defined in#

src/acp/policy.ts:464


getResourcePolicyAll#

getResourcePolicyAll(resourceWithAcr): ResourcePolicy[]

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Get all [[ResourcePolicy]]’s that apply to a Resource in its Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains Access Policies applying to it.

Returns#

ResourcePolicy[]

Defined in#

src/acp/policy.ts:528


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

Default value

Description

url

string | Url

undefined

URL of the SolidDataset to fetch.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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.

Defined in#

src/acp/acp.ts:160


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

Default value

Description

url

string | Url

undefined

URL of the SolidDataset to fetch.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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:67


getVcAccess#

getVcAccess(resourceWithAcr): AccessModes

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Get the maximum access modes that are allowed for a VC holder for a given resource. If the resource owner issued an Access Grant for the resource, the agent that has been granted access will have at most the permissions returned by this function. The Access Grant may be more restrictive.

Note that only the modes set using [[setVcAccess]] will be returned by this function. Additional access may have been set if the ACR has been manipulated not using this library, which is currently out of scope.

Since

1.17.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The resource for which the VC access modes are looked up.

Returns#

AccessModes

The access modes available to a VC holder.

Defined in#

src/acp/util/getVcAccess.ts:75


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]].

Defined in#

src/acp/acp.ts:309


hasAuthenticated#

hasAuthenticated(matcher): boolean

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Check if the Matcher applies to any authenticated agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher checked for authenticated access.

Returns#

boolean

Whether the Matcher applies to any authenticated agent or not.

Defined in#

src/acp/matcher.ts:695


hasCreator#

hasCreator(matcher): boolean

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Check if the Matcher applies to the creator of the Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher checked for authenticated access.

Returns#

boolean

Whether the Matcher applies to the creator of the Resource or not.

Defined in#

src/acp/matcher.ts:752


hasLinkedAcr#

hasLinkedAcr<Resource>(resource): resource is WithLinkedAcr<Resource>

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.

Given a Resource, check whether it is governed by Access Policies. (Specifically, a Resource that is governed by Access Policies will refer to exactly one Access Control Resource, and expose that to users who are allowed to see or modify access to the given Resource.)

Since

1.6.0

Type parameters#

Name

Type

Resource

extends WithServerResourceInfo

Parameters#

Name

Type

Description

resource

Resource

Resource which may or may not be governed by Access Policies.

Returns#

resource is WithLinkedAcr<Resource>

True if the Resource refers to an Access Control Resource and is hence governed by Access Policies, or false if it does not.

Defined in#

src/acp/control.ts:75


hasPublic#

hasPublic(matcher): boolean

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Check if the Matcher applies to any agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher checked for public access.

Returns#

boolean

Whether the Matcher applies to any agent or not.

Defined in#

src/acp/matcher.ts:639


isAcpControlled#

isAcpControlled(resource, options?): Promise<boolean>

Verify whether the access to the given resource is controlled using the ACP system.

Since

1.14.0.

Parameters#

Name

Type

Default value

Description

resource

string | Url

undefined

The target resource

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

internal_defaultFetchOptions

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

Returns#

Promise<boolean>

True if the access to the resource is controlled using ACP, false otherwise.

Defined in#

src/acp/acp.ts:424


mockAcrFor#

mockAcrFor(resourceUrl): AccessControlResource

Warning

Do not use this function in production code. For use in unit tests that require a [[AccessControlResource]].

Initialises a new empty Access Control Resource for a given Resource for use in unit tests.

Since

1.6.0

Parameters#

Name

Type

Description

resourceUrl

string

The URL of the Resource to which the mocked ACR should apply.

Returns#

AccessControlResource

The mocked empty Access Control Resource for the given Resource.

Defined in#

src/acp/mock.ts:43


removeAcrPolicyUrl#

removeAcrPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Remove a policy applying to the ACR of the given resource.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to remove the URL of a policy applying to its access control resource.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/removeAcrPolicyUrl.ts:45


removeAcrPolicyUrlAll#

removeAcrPolicyUrlAll<ResourceExt>(resourceWithAcr): 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.

Stop all URL of Access Policies from applying to an Access Control Resource itself.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource to which no more Policies should apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but without any Policy applying to it.

Defined in#

src/acp/control.ts:308


removeAgent#

removeAgent(matcher, agent): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Prevent the [[Matcher]] from applying to a given agent directly. This will not prevent the agent from matching on other properties than its WebID.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The [[Matcher]] that should no longer apply to a given agent.

agent

string

The agent the Matcher should no longer apply to.

Returns#

Matcher

A copy of the Matcher, not applying to the given agent.

Defined in#

src/acp/matcher.ts:624


removeAllOfMatcherUrl#

removeAllOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Removes a Matcher that refines the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] from which the Matcher should be removed.

matcher

string | Url | ThingPersisted

The Matcher to remove from the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the Matcher removed.

Defined in#

src/acp/matcher.ts:104


removeAnyOfMatcherUrl#

removeAnyOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Removes a Matcher that extends the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] from which the Matcher should be removed.

matcher

string | Url | ThingPersisted

The Matcher to remove from the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the Matcher removed.

Defined in#

src/acp/matcher.ts:183


removeAuthenticated#

removeAuthenticated(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to no longer apply to any authenticated Agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to apply/not apply to any authenticated agent.

Defined in#

src/acp/matcher.ts:737


removeClient#

removeClient(matcher, client): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Prevent the [[Matcher]] from applying to a given Client directly.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The [[Matcher]] that should no longer apply to a given Client.

client

string | Url

The Client the Matcher should no longer apply to.

Returns#

Matcher

A copy of the Matcher, not applying to the given Client.

Defined in#

src/acp/matcher.ts:869


removeCreator#

removeCreator(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to no longer apply to the creator of a Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to apply/not apply to the creator of a Resource.

Defined in#

src/acp/matcher.ts:793


removeMatcher#

removeMatcher<Dataset>(matcherResource, matcher): Dataset

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Removes the given [[Matcher]] from the given [[SolidDataset]].

Since

Not released yet.

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

matcherResource

Dataset

The Resource that contains (zero or more) [[Matcher]]s.

matcher

string | Url | ThingPersisted

-

Returns#

Dataset

A new SolidDataset equal to the given Matcher Resource, but without the given Matcher.

Defined in#

src/acp/matcher.ts:444


removeMemberAcrPolicyUrl#

removeMemberAcrPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Remove a policy applying to the ACRs of the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to remove the URL of a policy applying to its children’s access control resources.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/removeMemberAcrPolicyUrl.ts:45


removeMemberAcrPolicyUrlAll#

removeMemberAcrPolicyUrlAll<ResourceExt>(resourceWithAcr): 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.

Stop all URL of Access Policies from applying to the Access Control Resources of the Resource’s children.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource that should no longer apply Policies to its children’s ACRs.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but without any Policy applying to its children’s ACRs.

Defined in#

src/acp/control.ts:336


removeMemberPolicyUrl#

removeMemberPolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Remove a policy applying to the given resource’s children.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to remove the URL of a policy applying to its children.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/removeMemberPolicyUrl.ts:45


removeMemberPolicyUrlAll#

removeMemberPolicyUrlAll<ResourceExt>(resourceWithAcr): 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.

Stop all URL of Access Policies from applying to the Resource’s children.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource that should no longer apply Policies to its children.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but without any Policy applying to the Resource’s children.

Defined in#

src/acp/control.ts:537


removeNoneOfMatcherUrl#

removeNoneOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Removes a Matcher that restricts the scope of a given the [[Policy]]. If an agent requesting access to a resource is matched by another Matcher, but also in any of the “None Of” Matchers, they will not be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] from which the Matcher should be removed.

matcher

string | Url | ThingPersisted

The Matcher to remove from the policy.

Returns#

P

A new [[Policy]] clone of the original one, with the Matcher removed.

Defined in#

src/acp/matcher.ts:263


removePolicy#

removePolicy<Dataset>(policyResource, policy): Dataset

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Remove the given [[Policy]] from the given [[SolidDataset]].

Since

1.6.0

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

policyResource

Dataset

The Resource that contains Access Policies.

policy

string | Url | ThingPersisted

The Policy to remove from the resource.

Returns#

Dataset

Defined in#

src/acp/policy.ts:160


removePolicyUrl#

removePolicyUrl<T>(resourceWithAcr, policyUrl): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Remove a policy applying to the given resource.

Since

1.16.1

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The resource for which to remove the URL of a policy applying to it.

policyUrl

string | Url

A Policy URL.

Returns#

T

The resource with its ammended access control resource.

Defined in#

src/acp/policy/removePolicyUrl.ts:45


removePolicyUrlAll#

removePolicyUrlAll<ResourceExt>(resourceWithAcr): 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.

Stop all URL of Access Policies from applying to a Resource.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource, with its Access Control Resource, to which no more Policies should apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but without any Policy applying to the Resource.

Defined in#

src/acp/control.ts:512


removePublic#

removePublic(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to no longer apply to any Agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to no longer apply to any agent.

Defined in#

src/acp/matcher.ts:680


removeResourceAcrPolicy#

removeResourceAcrPolicy<ResourceExt>(resourceWithAcr, policy): ResourceExt

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Remove the given [[ResourcePolicy]] that applies to a given Resource’s Access Control Resource from that Access Control Resource.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains Access Policies.

policy

string | Url | ThingPersisted

The ACR Policy to remove from the Resource’s Access Control Resource.

Returns#

ResourceExt

Defined in#

src/acp/policy.ts:628


removeResourceMatcher#

removeResourceMatcher<ResourceExt>(resourceWithAcr, matcher): ResourceExt

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Removes the given [[ResourceMatcher]] from the given Resource’s Access Control Resource.

Since

Not released yet.

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains (zero or more) [[ResourceMatcher]]s.

matcher

string | Url | ThingPersisted

-

Returns#

ResourceExt

A new Resource equal to the given Resource, but without the given Matcher in its ACR.

Defined in#

src/acp/matcher.ts:462


removeResourcePolicy#

removeResourcePolicy<ResourceExt>(resourceWithAcr, policy): ResourceExt

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Remove the given [[ResourcePolicy]] from the given Resource’s Access Control Resource.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains Access Policies.

policy

string | Url | ThingPersisted

The Policy to remove from the Resource’s Access Control Resource.

Returns#

ResourceExt

Defined in#

src/acp/policy.ts:575


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

extends WithAccessibleAcr

Parameters#

Name

Type

Default value

Description

resource

ResourceExt

undefined

Resource with an Access Control Resource that should be saved.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

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>

Defined in#

src/acp/acp.ts:268


setAgent#

setAgent(matcher, agent): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Overwrite the agents the [[Matcher]] applies to with the provided agents.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The matcher for which agents are set.

agent

string

The agent the matcher should apply to.

Returns#

Matcher

A copy of the input matcher, applying to a different set of agents.

Defined in#

src/acp/matcher.ts:575


setAllOfMatcherUrl#

setAllOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Overwrites the Matcher refining the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to set for the Policy.

Returns#

P

A new [[Policy]] clone of the original one, with the “All Of” Matchers replaced.

Defined in#

src/acp/matcher.ts:124


setAllowModes#

setAllowModes<P>(policy, modes): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Given a [[Policy]] and a set of [[AccessModes]], return a new Policy based on the given Policy, but with the given Access Modes allowed on it.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The Policy on which to set the modes to allow.

modes

AccessModes

Modes to allow for this Policy.

Returns#

P

Defined in#

src/acp/policy.ts:198


setAnyOfMatcherUrl#

setAnyOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Overwrite the Matcher extending the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to set for the Policy.

Returns#

P

A new [[Policy]] clone of the original one, with the “Any Of” Matchers replaced.

Defined in#

src/acp/matcher.ts:203


setAuthenticated#

setAuthenticated(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to apply to any authenticated Agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to apply to any authenticated Agent.

Defined in#

src/acp/matcher.ts:714


setCreator#

setCreator(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to apply to the creator of a Resource.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to apply to the creator of a Resource.

Defined in#

src/acp/matcher.ts:770


setDenyModes#

setDenyModes<P>(policy, modes): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Given a [[Policy]] and a set of [[AccessModes]], return a new Policy based on the given Policy, but with the given Access Modes disallowed on it.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The Policy on which to set the modes to disallow.

modes

AccessModes

Modes to disallow for this Policy.

Returns#

P

Defined in#

src/acp/policy.ts:320


setMatcher#

setMatcher<Dataset>(matcherResource, matcher): Dataset

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Insert the given [[Matcher]] into the given [[SolidDataset]], replacing previous instances of that Matcher.

Since

Not released yet.

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

matcherResource

Dataset

The Resource that contains (zero or more) [[Matcher]]s.

matcher

ThingPersisted

-

Returns#

Dataset

A new SolidDataset equal to the given Matcher Resource, but with the given Matcher.

Defined in#

src/acp/matcher.ts:513


setNoneOfMatcherUrl#

setNoneOfMatcherUrl<P>(policy, matcher): P

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set the Matchers restricting the scope of a given [[Policy]]. If an agent requesting access to a resource is matched by another Matcher, but also by any of the “None Of” Matchers, they will not be granted access.

Since

Not released yet.

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

The [[Policy]] to which the Matcher should be added.

matcher

string | Url | ThingPersisted

The Matcher to set for the Policy.

Returns#

P

A new [[Policy]] clone of the original one, with the “None Of” Matchers replaced.

Defined in#

src/acp/matcher.ts:284


setPolicy#

setPolicy<Dataset>(policyResource, policy): Dataset

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Insert the given [[Policy]] into the given [[SolidDataset]], replacing previous instances of that Policy.

Since

1.6.0

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

policyResource

Dataset

The Resource that contains Access Policies.

policy

ThingPersisted

The Policy to insert into the Resource.

Returns#

Dataset

A new dataset equal to the given resource, but with the given Policy.

Defined in#

src/acp/policy.ts:179


setPublic#

setPublic(matcher): Matcher

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Set a Matcher to apply to any Agent.

Since

Not released yet.

Parameters#

Name

Type

Description

matcher

ThingPersisted

The Matcher being modified.

Returns#

Matcher

A copy of the Matcher, updated to apply to any agent.

Defined in#

src/acp/matcher.ts:657


setResourceMatcher#

setResourceMatcher<ResourceExt>(resourceWithAcr, matcher): ResourceExt

Note

There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.

Insert the given [[ResourceMatcher]] into the given Resource’s Access Control Resource, replacing previous instances of that Matcher.

Since

Not released yet.

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains (zero or more) [[ResourceMatcher]]s.

matcher

ThingPersisted

-

Returns#

ResourceExt

A new Resource equal to the given Resource, but with the given Matcher in its ACR.

Defined in#

src/acp/matcher.ts:532


setResourcePolicy#

setResourcePolicy<T>(resourceWithAcr, policy): T

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Insert the given [[ResourcePolicy]] into the given Resource’s Acccess Control Resource, replacing previous instances of that Policy.

Since

1.18.0

Type parameters#

Name

Type

T

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

T

The Resource whose Access Control Resource contains Access Policies.

policy

ThingPersisted

The Policy to insert into the Resource’s Access Control Resource.

Returns#

T

A new Resource equal to the given Resource, but with the given Policy in its Access Control Resource.

Defined in#

src/acp/policy/setResourcePolicy.ts:41


setVcAccess#

setVcAccess(resourceWithAcr, access, options?): WithAccessibleAcr

Note

The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/

Set the maximum access modes that are allowed for a VC holder for a given resource. If the resource owner issued an Access Grant for the resource, the agent that has been granted access will have at most the permissions set by this function. The Access Grant may be more restrictive.

Note that additional access may have been set if the ACR has been manipulated not using this library, which is currently out of scope. In this case, the access set by this function may not apply.

Since

1.17.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The resource for which the access modes are being set for VC holders.

access

Partial<AccessModes>

The access modes to set. Setting a mode to true will enable it, to false will disable it, and to undefined will leave it unchanged compared to what was previously set.

options

Object

An option object to customize the function behavior: - inherit: if set to true, the access set to the target resource cascades to its contained resources.

options.inherit

boolean

-

Returns#

WithAccessibleAcr

A copy of the resource and its attached ACR, updated to the new access modes.

Defined in#

src/acp/util/setVcAccess.ts:104