@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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to add the URL of a policy applying to its access control resource. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Matcher]] to be applied to an additional agent. |
|
|
|
The agent the [[Matcher]] should apply to. |
Returns#
Matcher
A copy of the [[Matcher]], applying to an additional agent.
Since
Not released yet.
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to add to the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the new Matcher added.
Since
Not released yet.
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to add to the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the new Matcher added.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Matcher]] to be applied to an additional Client. |
|
|
|
The Client the [[Matcher]] should apply to. |
Returns#
Matcher
A copy of the [[Matcher]], applying to an additional Client.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to add the URL of a policy applying to its children’s access control resources. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to add the URL of a policy applying to its children. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource to mock up with a new resource ACL. |
|
|
The Access Control Resource to attach to the given Resource. |
Returns#
T
& WithAccessibleAcr
The input Resource with an empty resource ACL attached.
Since
1.6.0
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to add to the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the new Matcher added.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to add the URL of a policy applying to it. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL that identifies this [[Matcher]]. |
Returns#
Matcher
Since
Not released yet.
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL that identifies this Policy. |
Returns#
Policy
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource to which the new Matcher is to apply. |
|
|
Name that identifies this [[Matcher]]. |
Returns#
ResourceMatcher
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource to which the Policy is to apply. |
|
|
The name that identifies this Policy. |
Returns#
ResourcePolicy
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to retrieve URLs of policies applying to its access control resource. |
Returns#
Policy URL array.
Since
1.16.1
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The matcher from which agents are read. |
Returns#
WebId
[]
A list of the WebIDs of agents included in the matcher.
Since
Not released yet.
Defined in#
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]]
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the Matchers should be read. |
Returns#
A list of the “All Of” [[Matcher]]s
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Policy for which you want to know the Access Modes it allows. |
Returns#
AccessModes
Since
Not released yet.
Defined in#
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]]
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the Matchers should be read. |
Returns#
A list of the “Any Of” [[Matcher]]s
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher from which clients are read. |
Returns#
WebId
[]
A list of the WebIDs of clients included in the Matcher.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Policy on which you want to know the Access Modes it disallows. |
Returns#
AccessModes
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the File to fetch. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<File
& WithAcp
| WithAcl
>
A File and either the ACL access data or the ACR access data, if available to the current user.
Since
1.6.0
Defined in#
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).
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the file to fetch. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<File
& WithAcp
>
A file and the ACR that applies to it, if available to the authenticated user.
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.15.0
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains the given [[Matcher]]. |
|
|
URL that identifies this [[Matcher]]. |
Returns#
Matcher
| null
The requested [[Matcher]], if it exists, or null
if it does not.
Since
Not released yet.
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains (zero or more) [[Matcher]]s. |
Returns#
Matcher
[]
The [[Matcher]]s contained in this resource.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to retrieve URLs of policies applying to its children’s access control resources. |
Returns#
Policy URL array.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to retrieve URLs policies applying to its children. |
Returns#
Policy URL array.
Since
1.16.1
Defined in#
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]]
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the Matchers should be read. |
Returns#
A list of the forbidden [[Matcher]]s
Since
Not released yet.
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains the given Policy. |
|
|
URL that identifies this Policy. |
Returns#
Policy
| null
The requested Policy, if it exists, or null
if it does not.
Since
1.6.0
Defined in#
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]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains Access Policies. |
Returns#
Policy
[]
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to retrieve URLs of policies applying to it. |
Returns#
Policy URL array.
Since
1.16.1
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
A Resource with an Access Control Resource attached. |
Returns#
List of all unique Access Policy Resources that are referenced in the given Access Control Resource.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose ACR contains the given Policy. |
|
|
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies. |
Returns#
ResourcePolicy
[]
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the Resource information about which to fetch. |
|
|
Optional parameter |
|
( |
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the Resource about which to fetch its information. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<WithServerResourceInfo
& WithAcp
>
Metadata describing a Resource, and the ACR that applies to it, if available to the authenticated user.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains the given [[ResourceMatcher]]. |
|
|
Name that identifies this [[ResourceMatcher]]. |
Returns#
ResourceMatcher
| null
The requested [[ResourceMatcher]], if it exists, or null
if it does not.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose ACR contains the given Policy. |
|
|
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies applying to it. |
Returns#
ResourcePolicy
[]
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the SolidDataset to fetch. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<SolidDataset
& WithAcp
| WithAcl
>
A SolidDataset and either the ACL access data or the ACR access data, if available to the current user.
Since
1.6.0
Defined in#
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).
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the SolidDataset to fetch. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<SolidDataset
& WithServerResourceInfo
& WithAcp
>
A SolidDataset and the ACR that applies to it, if available to the authenticated user.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which the VC access modes are looked up. |
Returns#
The access modes available to a VC holder.
Since
1.17.0
Defined in#
hasAccessibleAcr#
▸ hasAccessibleAcr(resource
): resource is WithAccessibleAcr
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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]].
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher checked for authenticated access. |
Returns#
boolean
Whether the Matcher applies to any authenticated agent or not.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher checked for authenticated access. |
Returns#
boolean
Whether the Matcher applies to the creator of the Resource or not.
Since
Not released yet.
Defined in#
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.)
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher checked for public access. |
Returns#
boolean
Whether the Matcher applies to any agent or not.
Since
Not released yet.
Defined in#
isAcpControlled#
▸ isAcpControlled(resource
, options?
): Promise
<boolean
>
Verify whether the access to the given resource is controlled using the ACP system.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The target resource |
|
|
Optional parameter |
|
( |
Returns#
Promise
<boolean
>
True if the access to the resource is controlled using ACP, false otherwise.
Since
1.14.0.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The URL of the Resource to which the mocked ACR should apply. |
Returns#
AccessControlResource
The mocked empty Access Control Resource for the given Resource.
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to remove the URL of a policy applying to its access control resource. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Matcher]] that should no longer apply to a given agent. |
|
|
|
The agent the Matcher should no longer apply to. |
Returns#
Matcher
A copy of the Matcher, not applying to the given agent.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] from which the Matcher should be removed. |
|
|
The Matcher to remove from the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the Matcher removed.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] from which the Matcher should be removed. |
|
|
The Matcher to remove from the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the Matcher removed.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to apply/not apply to any authenticated agent.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Matcher]] that should no longer apply to a given Client. |
|
|
|
The Client the Matcher should no longer apply to. |
Returns#
Matcher
A copy of the Matcher, not applying to the given Client.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to apply/not apply to the creator of a Resource.
Since
Not released yet.
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains (zero or more) [[Matcher]]s. |
|
|
- |
Returns#
Dataset
A new SolidDataset equal to the given Matcher Resource, but without the given Matcher.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to remove the URL of a policy applying to its children’s access control resources. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to remove the URL of a policy applying to its children. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] from which the Matcher should be removed. |
|
|
The Matcher to remove from the policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the Matcher removed.
Since
Not released yet.
Defined in#
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]].
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains Access Policies. |
|
|
The Policy to remove from the resource. |
Returns#
Dataset
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which to remove the URL of a policy applying to it. |
|
|
A Policy URL. |
Returns#
T
The resource with its ammended access control resource.
Since
1.16.1
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
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.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to no longer apply to any agent.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies. |
|
|
The ACR Policy to remove from the Resource’s Access Control Resource. |
Returns#
ResourceExt
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains (zero or more) [[ResourceMatcher]]s. |
|
|
- |
Returns#
ResourceExt
A new Resource equal to the given Resource, but without the given Matcher in its ACR.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies. |
|
|
The Policy to remove from the Resource’s Access Control Resource. |
Returns#
ResourceExt
Since
1.6.0
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
Resource with an Access Control Resource that should be saved. |
|
|
Optional parameter |
|
( |
Returns#
Promise
<ResourceExt
>
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The matcher for which agents are set. |
|
|
|
The agent the matcher should apply to. |
Returns#
Matcher
A copy of the input matcher, applying to a different set of agents.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to set for the Policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the “All Of” Matchers replaced.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Policy on which to set the modes to allow. |
|
|
Modes to allow for this Policy. |
Returns#
P
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to set for the Policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the “Any Of” Matchers replaced.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to apply to any authenticated Agent.
Since
Not released yet.
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to apply to the creator of a Resource.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Policy on which to set the modes to disallow. |
|
|
Modes to disallow for this Policy. |
Returns#
P
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains (zero or more) [[Matcher]]s. |
|
- |
Returns#
Dataset
A new SolidDataset equal to the given Matcher Resource, but with the given Matcher.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[Policy]] to which the Matcher should be added. |
|
|
The Matcher to set for the Policy. |
Returns#
P
A new [[Policy]] clone of the original one, with the “None Of” Matchers replaced.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains Access Policies. |
|
The Policy to insert into the Resource. |
Returns#
Dataset
A new dataset equal to the given resource, but with the given Policy.
Since
1.6.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
The Matcher being modified. |
Returns#
Matcher
A copy of the Matcher, updated to apply to any agent.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains (zero or more) [[ResourceMatcher]]s. |
|
- |
Returns#
ResourceExt
A new Resource equal to the given Resource, but with the given Matcher in its ACR.
Since
Not released yet.
Defined in#
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.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies. |
|
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.
Since
1.18.0
Defined in#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The resource for which the access modes are being set for VC holders. |
|
|
The access modes to set. Setting a mode to |
|
|
An option object to customize the function behavior: - inherit: if set to |
|
|
- |
Returns#
WithAccessibleAcr
A copy of the resource and its attached ACR, updated to the new access modes.
Since
1.17.0