@inrupt/solid-client / acp_ess_1

Module: acp_ess_1#

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 1.1 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_1 } from "@inrupt/solid-client";

References#

addMockAcrTo#

Re-exports addMockAcrTo


createPolicy#

Re-exports createPolicy


createResourcePolicyFor#

Re-exports createResourcePolicyFor


getFileWithAccessDatasets#

Re-exports getFileWithAccessDatasets


getFileWithAcr#

Re-exports getFileWithAcr


getLinkedAcrUrl#

Re-exports getLinkedAcrUrl


getPolicy#

Re-exports getPolicy


getPolicyAll#

Re-exports getPolicyAll


getReferencedPolicyUrlAll#

Re-exports getReferencedPolicyUrlAll


getResourceAcrPolicy#

Re-exports getResourceAcrPolicy


getResourceAcrPolicyAll#

Re-exports getResourceAcrPolicyAll


getResourceInfoWithAccessDatasets#

Re-exports getResourceInfoWithAccessDatasets


getResourceInfoWithAcr#

Re-exports getResourceInfoWithAcr


getResourcePolicy#

Re-exports getResourcePolicy


getResourcePolicyAll#

Re-exports getResourcePolicyAll


getSolidDatasetWithAccessDatasets#

Re-exports getSolidDatasetWithAccessDatasets


getSolidDatasetWithAcr#

Re-exports getSolidDatasetWithAcr


hasAccessibleAcr#

Re-exports hasAccessibleAcr


hasLinkedAcr#

Re-exports hasLinkedAcr


isAcpControlled#

Re-exports isAcpControlled


mockAcrFor#

Re-exports mockAcrFor


removeAcrPolicyUrlAll#

Re-exports removeAcrPolicyUrlAll


removeMemberAcrPolicyUrlAll#

Re-exports removeMemberAcrPolicyUrlAll


removeMemberPolicyUrlAll#

Re-exports removeMemberPolicyUrlAll


removePolicy#

Re-exports removePolicy


removePolicyUrlAll#

Re-exports removePolicyUrlAll


removeResourceAcrPolicy#

Re-exports removeResourceAcrPolicy


removeResourcePolicy#

Re-exports removeResourcePolicy


saveAcrFor#

Re-exports saveAcrFor


setPolicy#

Re-exports setPolicy

Functions#

acrAsMarkdown#

acrAsMarkdown(resourceWithAcr): string

Gets a human-readable representation of the given [[Control]] to aid debugging.

Note that changes to the exact format of the return value are not considered a breaking change; it is intended to aid in debugging, not as a serialisation method that can be reliably parsed.

Since

1.6.0

Deprecated

Parameters#

Name

Type

Description

resourceWithAcr

WithResourceInfo & WithAcp & { internal_acp: { acr: AccessControlResource } }

The Resource with an attached Access Control Resource of which you want to get a human-readable representation.

Returns#

string

Defined in#

src/acp/control.ts:561


addAcrPolicyUrl#

addAcrPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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.

Add a [[Policy]] to an Access Control Resource such that that [[Policy]] applies to the Access Control Resource itself, rather than the Resource it governs.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with an Access Control Resource to which the ACR Policy should be added.

policyUrl

string | Url | ThingPersisted

URL of the Policy that should apply to the given Access Control Resource.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given ACR Policy added to it.

Defined in#

src/acp/control.ts:145


addAgent#

addAgent(rule, agent): Rule

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 [[Rule]] to an additional agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

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

agent

string

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

Returns#

Rule

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

Defined in#

src/acp/rule.ts:609


addAllOfRuleUrl#

addAllOfRuleUrl<P>(policy, rule): 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 rule 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” rules, they will not be granted access.

Also see [[addAnyOfRuleUrl]] and [[addNoneOfRuleUrl]].

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to add to the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:87


addAnyOfRuleUrl#

addAnyOfRuleUrl<P>(policy, rule): 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 rule 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” rules, they will be granted access.

Also see [[addAllOfRuleUrl]] and [[addNoneOfRuleUrl]].

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to add to the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:166


addClient#

addClient(rule, client): Rule

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 [[Rule]] to an additional Client.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

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

client

string

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

Returns#

Rule

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

Defined in#

src/acp/rule.ts:920


addGroup#

addGroup(rule, group): Rule

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 [[Rule]] to an additional group.

Since

1.6.0

Deprecated

Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.

Parameters#

Name

Type

Description

rule

ThingPersisted

The [[Rule]] to be applied to an additional group.

group

string

-

Returns#

Rule

A copy of the [[Rule]], applying to an additional group.

Defined in#

src/acp/rule.ts:676


addMemberAcrPolicyUrl#

addMemberAcrPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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.

Add a [[Policy]] to a Resource’s Access Control Resource such that that Policy applies to the Access Control Resources of child Resources.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with an Access Control Resource to which the ACR Policy should be added.

policyUrl

string | Url | ThingPersisted

URL of the Policy that should apply to the given Access Control Resources of children of the Resource.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given ACR Policy added to it.

Defined in#

src/acp/control.ts:173


addMemberPolicyUrl#

addMemberPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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.

Add a [[Policy]] to a Resource’s Access Control Resource such that that Policy applies to that Resource’s children.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource to whose Access Control Resource the Policy should be added.

policyUrl

string | Url

URL of the Policy that should apply to the given Resource’s children.

Returns#

ResourceExt

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

Defined in#

src/acp/control.ts:387


addNoneOfRuleUrl#

addNoneOfRuleUrl<P>(policy, rule): 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 rule that restricts the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the forbidden rules, they will not be granted access.

Also see [[addAllOfRuleUrl]] and [[addAnyOfRuleUrl]].

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to add to the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:245


addPolicyUrl#

addPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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.

Add a [[Policy]] to an Access Control Resource such that that [[Policy]] applies to that Resource.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource to which the ACR Policy should be added.

policyUrl

string | Url

URL of the Policy that should apply to the given Resource.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given Policy added to it.

Defined in#

src/acp/control.ts:364


createResourceRuleFor#

createResourceRuleFor(resourceWithAcr, name): ResourceRule

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 [[ResourceRule]] for the given Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource to which the new Rule is to apply.

name

string

Name that identifies this [[Rule]].

Returns#

ResourceRule

Defined in#

src/acp/rule.ts:336


createRule#

createRule(url): Rule

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

Since

1.6.0

Parameters#

Name

Type

Description

url

string | Url

URL that identifies this [[Rule]].

Returns#

Rule

Defined in#

src/acp/rule.ts:318


getAcrPolicyUrlAll#

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

Get the URLs of the Access Policies that apply to an Access Control Resource itself, rather than to the Resource it governs.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource of which to get the URLs of the Policies that govern access to it.

Returns#

UrlString[]

URLs of the Policies that govern access to the given Access Control Resource.

Defined in#

src/acp/control.ts:200


getAgentAll#

getAgentAll(rule): 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 [[Rule]] applies directly to. This will not include agents that are part of a group the [[Rule]] applies to, nor will it include specific agent classes, such as authenticated or public agents.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule from which agents are read.

Returns#

WebId[]

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

Defined in#

src/acp/rule.ts:556


getAllOfRuleUrlAll#

getAllOfRuleUrlAll<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” [[Rule]]s for the given [[Policy]]

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

Returns#

UrlString[]

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

Defined in#

src/acp/rule.ts:144


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

1.6.0

Deprecated

The Access Control Policies proposal will be updated to use a different vocabulary for allow- and deny-modes. To be compatible with servers that implement that, use [[getAllowModesV2]].

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


getAnyOfRuleUrlAll#

getAnyOfRuleUrlAll<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” [[Rule]]s for the given [[Policy]]

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

Returns#

UrlString[]

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

Defined in#

src/acp/rule.ts:223


getClientAll#

getClientAll(rule): 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 [[Rule]] applies directly to. This will not include specific client classes, such as public clients.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule from which clients are read.

Returns#

WebId[]

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

Defined in#

src/acp/rule.ts:878


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

1.6.0

Deprecated

The Access Control Policies proposal will be updated to use a different vocabulary for allow- and deny-modes. To be compatible with servers that implement that, use [[getDenyModesV2]].

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


getGroupAll#

getGroupAll(rule): 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.

Lists all the groups a [[Rule]] applies to.

Since

1.6.0

Deprecated

Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule from which groups are read.

Returns#

UrlString[]

A list of the [[URL]]’s of groups included in the rule.

Defined in#

src/acp/rule.ts:642


getMemberAcrPolicyUrlAll#

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

Get the URLs of the Access Policies that apply 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 of which to get the URLs of the Policies that govern access to its children.

Returns#

UrlString[]

URLs of the Policies that govern access to the Access Control Resources of the given Resource’s children.

Defined in#

src/acp/control.ts:225


getMemberPolicyUrlAll#

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

Get the URLs of the Access Policies that apply to a 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 of which to get the URLs of the Policies that govern access to its children.

Returns#

UrlString[]

URLs of the Policies that govern access to the given Resource’s children.

Defined in#

src/acp/control.ts:433


getNoneOfRuleUrlAll#

getNoneOfRuleUrlAll<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” [[Rule]]s for the given [[Policy]]

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

Returns#

UrlString[]

A list of the forbidden [[Rule]]s

Defined in#

src/acp/rule.ts:302


getPolicyUrlAll#

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

Get the URLs of the Access Policies that apply to a Resource.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource of which to get the URLs of the Policies that govern access to it.

Returns#

UrlString[]

URLs of the Policies that govern access to the given Resource.

Defined in#

src/acp/control.ts:408


getResourceRule#

getResourceRule(resourceWithAcr, name): ResourceRule | 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 [[ResourceRule]] with the given name from an Resource’s Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

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

name

string

Name that identifies this [[ResourceRule]].

Returns#

ResourceRule | null

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

Defined in#

src/acp/rule.ts:384


getResourceRuleAll#

getResourceRuleAll(resourceWithAcr): ResourceRule[]

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 [[ResourceRule]]s from a Resource’s Access Control Resource.

Since

1.6.0

Parameters#

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

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

Returns#

ResourceRule[]

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

Defined in#

src/acp/rule.ts:426


getRule#

getRule(ruleResource, url): Rule | 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 [[Rule]] with the given URL from an [[SolidDataset]].

Since

1.6.0

Parameters#

Name

Type

Description

ruleResource

Readonly<{}>

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

url

string | Url

URL that identifies this [[Rule]].

Returns#

Rule | null

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

Defined in#

src/acp/rule.ts:360


getRuleAll#

getRuleAll(ruleResource): Rule[]

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 [[Rule]]s from a [[SolidDataset]].

Since

1.6.0

Parameters#

Name

Type

Description

ruleResource

Readonly<{}>

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

Returns#

Rule[]

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

Defined in#

src/acp/rule.ts:410


hasAnyClient#

hasAnyClient(rule): 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 rule applies to any client, i.e. all the applications regardless of their identifier.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule checked for authenticated access.

Returns#

boolean

Whether the rule applies to public clients.

Defined in#

src/acp/rule.ts:952


hasAuthenticated#

hasAuthenticated(rule): 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 rule applies to any authenticated agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule checked for authenticated access.

Returns#

boolean

Whether the rule applies to any authenticated agent or not.

Defined in#

src/acp/rule.ts:764


hasCreator#

hasCreator(rule): 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 rule applies to the creator of the Resource.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule checked for authenticated access.

Returns#

boolean

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

Defined in#

src/acp/rule.ts:821


hasPublic#

hasPublic(rule): 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 rule applies to any agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule checked for public access.

Returns#

boolean

Whether the rule applies to any agent or not.

Defined in#

src/acp/rule.ts:708


policyAsMarkdown#

policyAsMarkdown(policy): string

Gets a human-readable representation of the given [[Policy]] to aid debugging.

Note that changes to the exact format of the return value are not considered a breaking change; it is intended to aid in debugging, not as a serialisation method that can be reliably parsed.

Since

1.6.0

Deprecated

Parameters#

Name

Type

Description

policy

ThingPersisted

The Policy to get a human-readable representation of.

Returns#

string

Defined in#

src/acp/policy.ts:724


removeAcrPolicyUrl#

removeAcrPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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 the URL of a given [[Policy]] 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 the given URL of a Policy should no longer apply.

policyUrl

string | Url | ThingPersisted

The URL of the Policy that should no longer apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given ACR Policy removed from it.

Defined in#

src/acp/control.ts:250


removeAgent#

removeAgent(rule, agent): Rule

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 [[Rule]] from applying to a given agent directly. This will not remove the agent from any groups the rule applies to.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

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

agent

string

The agent the rule should no longer apply to.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:626


removeAllOfRuleUrl#

removeAllOfRuleUrl<P>(policy, rule): 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 rule 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” rules, they will not be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to remove from the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:107


removeAnyClient#

removeAnyClient(rule): Rule

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.

Make the [[Rule]] no longer apply to any client application.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule for which clients are set.

Returns#

Rule

A copy of the rule, updated to no longer apply to any client

Defined in#

src/acp/rule.ts:986


removeAnyOfRuleUrl#

removeAnyOfRuleUrl<P>(policy, rule): 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 rule 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” rules, they will be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to remove from the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:186


removeAuthenticated#

removeAuthenticated(rule): Rule

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 Rule to no longer apply to any authenticated Agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:806


removeClient#

removeClient(rule, client): Rule

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 [[Rule]] from applying to a given Client directly.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

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

client

string

The Client the rule should no longer apply to.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:936


removeCreator#

removeCreator(rule): Rule

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 Rule to no longer apply to the creator of a Resource.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:862


removeGroup#

removeGroup(rule, group): Rule

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 [[Rule]] from applying to a given group.

Since

1.6.0

Deprecated

Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.

Parameters#

Name

Type

Description

rule

ThingPersisted

The [[Rule]] that should no longer apply to a given group.

group

string

-

Returns#

Rule

A copy of the rule, not applying to the given group.

Defined in#

src/acp/rule.ts:693


removeMemberAcrPolicyUrl#

removeMemberAcrPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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 the URL of a given [[Policy]] 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 to whose children’s ACRs the given URL of a Policy should no longer apply.

policyUrl

string | Url | ThingPersisted

The URL of the Policy that should no longer apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given member ACR Policy removed from it.

Defined in#

src/acp/control.ts:280


removeMemberPolicyUrl#

removeMemberPolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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 the URL of a given [[Policy]] 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 to whose children the given URL of a Policy should no longer apply.

policyUrl

string | Url | ThingPersisted

The URL of the Policy that should no longer apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given Member Policy removed from it.

Defined in#

src/acp/control.ts:486


removeNoneOfRuleUrl#

removeNoneOfRuleUrl<P>(policy, rule): 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 rule that restricts the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the forbidden rules, they will not be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

The rule to remove from the policy.

Returns#

P

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

Defined in#

src/acp/rule.ts:265


removePolicyUrl#

removePolicyUrl<ResourceExt>(resourceWithAcr, policyUrl): 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 the URL of a given [[Policy]] 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 the given URL of a Policy should no longer apply.

policyUrl

string | Url | ThingPersisted

The URL of the Policy that should no longer apply.

Returns#

ResourceExt

A Resource with a new Access Control Resource equal to the original ACR, but with the given Policy removed from it.

Defined in#

src/acp/control.ts:459


removePublic#

removePublic(rule): Rule

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 Rule to no longer apply to any Agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:749


removeResourceRule#

removeResourceRule<ResourceExt>(resourceWithAcr, rule): 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 [[ResourceRule]] 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 (zero or more) [[ResourceRule]]s.

rule

string | Url | ThingPersisted

-

Returns#

ResourceExt

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

Defined in#

src/acp/rule.ts:463


removeRule#

removeRule<Dataset>(ruleResource, rule): 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 [[Rule]] from the given [[SolidDataset]].

Since

1.6.0

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

ruleResource

Dataset

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

rule

string | Url | ThingPersisted

-

Returns#

Dataset

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

Defined in#

src/acp/rule.ts:445


ruleAsMarkdown#

ruleAsMarkdown(rule): string

Gets a human-readable representation of the given [[Rule]] to aid debugging.

Note that changes to the exact format of the return value are not considered a breaking change; it is intended to aid in debugging, not as a serialisation method that can be reliably parsed.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The Rule to get a human-readable representation of.

Returns#

string

Defined in#

src/acp/rule.ts:999


setAgent#

setAgent(rule, agent): Rule

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 [[Rule]] applies to with the provided agents.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule for which agents are set.

agent

string

The agent the rule should apply to.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:577


setAllOfRuleUrl#

setAllOfRuleUrl<P>(policy, rule): 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 rule 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” rules, they will not be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

-

Returns#

P

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

Defined in#

src/acp/rule.ts:127


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

1.6.0

Deprecated

The Access Control Policies proposal will be updated to use a different vocabulary for allow- and deny-modes. To be compatible with servers that implement that, use [[setAllowModesV2]].

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


setAnyClient#

setAnyClient(rule): Rule

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.

Make the [[Rule]] apply to any client application.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule for which clients are set.

Returns#

Rule

A copy of the rule, updated to apply to any client

Defined in#

src/acp/rule.ts:971


setAnyOfRuleUrl#

setAnyOfRuleUrl<P>(policy, rule): 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 rule extending the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” rules, they will be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

-

Returns#

P

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

Defined in#

src/acp/rule.ts:206


setAuthenticated#

setAuthenticated(rule): Rule

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 Rule to apply to any authenticated Agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:783


setClient#

setClient(rule, client): Rule

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 clients the [[Rule]] applies to with the provided Client.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule for which clients are set.

client

string

The Client the rule should apply to.

Returns#

Rule

A copy of the input rule, applying to a different set of Clients.

Defined in#

src/acp/rule.ts:896


setCreator#

setCreator(rule): Rule

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 Rule to apply to the creator of a Resource.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:839


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

1.6.0

Deprecated

The Access Control Policies proposal will be updated to use a different vocabulary for allow- and deny-modes. To be compatible with servers that implement that, use [[setDenyModesV2]].

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


setGroup#

setGroup(rule, group): Rule

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 groups the [[Rule]] applies to with the provided groups.

Since

1.6.0

Deprecated

Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule for which groups are set.

group

string

The group the rule should apply to.

Returns#

Rule

A copy of the input rule, applying to a different set of groups.

Defined in#

src/acp/rule.ts:659


setNoneOfRuleUrl#

setNoneOfRuleUrl<P>(policy, rule): 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 rules restrincting the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “None Of” rules, they will not be granted access.

Since

1.6.0

Type parameters#

Name

Type

P

extends ThingPersisted

Parameters#

Name

Type

Description

policy

P

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

rule

string | Url | ThingPersisted

-

Returns#

P

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

Defined in#

src/acp/rule.ts:285


setPublic#

setPublic(rule): Rule

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 Rule to apply to any Agent.

Since

1.6.0

Parameters#

Name

Type

Description

rule

ThingPersisted

The rule being modified.

Returns#

Rule

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

Defined in#

src/acp/rule.ts:726


setResourceAcrPolicy#

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

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

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

ThingPersisted

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

Returns#

ResourceExt

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

Defined in#

src/acp/policy.ts:703


setResourcePolicy#

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

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

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

ThingPersisted

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

Returns#

ResourceExt

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

Defined in#

src/acp/policy.ts:678


setResourceRule#

setResourceRule<ResourceExt>(resourceWithAcr, rule): 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 [[ResourceRule]] into the given Resource’s Access Control Resource, replacing previous instances of that Rule.

Since

1.6.0

Type parameters#

Name

Type

ResourceExt

extends WithAccessibleAcr

Parameters#

Name

Type

Description

resourceWithAcr

ResourceExt

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

rule

ThingPersisted

-

Returns#

ResourceExt

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

Defined in#

src/acp/rule.ts:533


setRule#

setRule<Dataset>(ruleResource, rule): 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 [[Rule]] into the given [[SolidDataset]], replacing previous instances of that Rule.

Since

1.6.0

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

ruleResource

Dataset

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

rule

ThingPersisted

-

Returns#

Dataset

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

Defined in#

src/acp/rule.ts:514