@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#
src/acp/policy/addAcrPolicyUrl.ts:46
addAgent#
▸ addAgent(matcher
, agent
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Apply the [[Matcher]] to an additional agent.
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#
src/acp/matcher.ts:607
addAllOfMatcherUrl#
▸ addAllOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Add a Matcher that refines the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.
Also see [[addAnyOfMatcherUrl]] and [[addNoneOfMatcherUrl]].
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#
src/acp/matcher.ts:84
addAnyOfMatcherUrl#
▸ addAnyOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Add a Matcher that extends the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.
Also see [[addAllOfMatcherUrl]] and [[addNoneOfMatcherUrl]].
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#
src/acp/matcher.ts:163
addClient#
▸ addClient(matcher
, client
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Apply the [[Matcher]] to an additional Client.
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#
src/acp/matcher.ts:850
addMemberAcrPolicyUrl#
▸ addMemberAcrPolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Add a policy applying to the ACRs of the given resource’s children.
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#
src/acp/policy/addMemberAcrPolicyUrl.ts:46
addMemberPolicyUrl#
▸ addMemberPolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Add a policy applying to the given resource’s children.
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#
src/acp/policy/addMemberPolicyUrl.ts:46
addMockAcrTo#
▸ addMockAcrTo<T
>(resource
, accessControlResource?
): T
& WithAccessibleAcr
Warning
Do not use this function in production code. For use in unit tests that require a Resource with an [[AccessControlResource]].
Attaches an Access Control Resource to a given [[SolidDataset]] for use in unit tests; e.g., unit tests that call [[getPolicyUrlAll]].
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#
src/acp/mock.ts:67
addNoneOfMatcherUrl#
▸ addNoneOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Add a Matcher that restricts the scope of a given the [[Policy]]. If an agent requesting access to a resource is matched by another Matcher, but also by the given Matcher, they will not be granted access.
Also see [[addAllOfMatcherUrl]] and [[addAnyOfMatcherUrl]].
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#
src/acp/matcher.ts:242
addPolicyUrl#
▸ addPolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Add a policy applying to the given resource.
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#
src/acp/policy/addPolicyUrl.ts:46
createMatcher#
▸ createMatcher(url
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Initialise a new, empty [[Matcher]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL that identifies this [[Matcher]]. |
Returns#
Matcher
Since
Not released yet.
Defined in#
src/acp/matcher.ts:317
createPolicy#
▸ createPolicy(url
): Policy
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Initialise a new, empty [[Policy]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL that identifies this Policy. |
Returns#
Policy
Since
1.6.0
Defined in#
src/acp/policy.ts:99
createResourceMatcherFor#
▸ createResourceMatcherFor(resourceWithAcr
, name
): ResourceMatcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Initialise a new, empty [[ResourceMatcher]] for the given Resource.
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#
src/acp/matcher.ts:335
createResourcePolicyFor#
▸ createResourcePolicyFor(resourceWithAcr
, name
): ResourcePolicy
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Initialise a new, empty [[ResourcePolicy]] for the given Resource.
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#
src/acp/policy.ts:438
getAcrPolicyUrlAll#
▸ getAcrPolicyUrlAll<T
>(resourceWithAcr
): UrlString
[]
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Get the URLs of policies applying to the ACR of the given resource.
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#
src/acp/policy/getAcrPolicyUrlAll.ts:42
getAgentAll#
▸ getAgentAll(matcher
): WebId
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
List all the agents a [[Matcher]] applies directly to. This will not include agents that are matched on a property other than their WebID.
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#
src/acp/matcher.ts:554
getAllOfMatcherUrlAll#
▸ getAllOfMatcherUrlAll<P
>(policy
): UrlString
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the “All Of” [[Matcher]]s for the given [[Policy]]
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#
src/acp/matcher.ts:141
getAllowModes#
▸ getAllowModes<P
>(policy
): AccessModes
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Given a [[Policy]], return which [[AccessModes]] it allows.
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#
src/acp/policy.ts:273
getAnyOfMatcherUrlAll#
▸ getAnyOfMatcherUrlAll<P
>(policy
): UrlString
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the “Any Of” [[Matcher]]s for the given [[Policy]]
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#
src/acp/matcher.ts:220
getClientAll#
▸ getClientAll(matcher
): WebId
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
List all the clients a [[Matcher]] applies directly to. This will not include specific client classes, such as public clients.
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#
src/acp/matcher.ts:809
getDenyModes#
▸ getDenyModes<P
>(policy
): AccessModes
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Given a [[Policy]], return which [[AccessModes]] it disallows.
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#
src/acp/policy.ts:391
getFileWithAccessDatasets#
▸ getFileWithAccessDatasets(url
, options?
): Promise
<File
& WithAcp
| WithAcl
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Fetch a File, and:
if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.
if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:198
getFileWithAcr#
▸ getFileWithAcr(url
, options?
): Promise
<File
& WithAcp
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Fetch a file and its associated Access Control Resource (if available to the current user).
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:96
getLinkedAcrUrl#
▸ getLinkedAcrUrl<Resource
>(resource
): UrlString
| undefined
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Given a Resource, find out the URL of its governing Access Control Resource.
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#
src/acp/acp.ts:451
getMatcher#
▸ getMatcher(matcherResource
, url
): Matcher
| null
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the [[Matcher]] with the given URL from an [[SolidDataset]].
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#
src/acp/matcher.ts:359
getMatcherAll#
▸ getMatcherAll(matcherResource
): Matcher
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Gets the [[Matcher]]s from a [[SolidDataset]].
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#
src/acp/matcher.ts:409
getMemberAcrPolicyUrlAll#
▸ getMemberAcrPolicyUrlAll<T
>(resourceWithAcr
): UrlString
[]
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Get the URLs of policies applying to the ACRs of the given resource’s children.
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#
src/acp/policy/getMemberAcrPolicyUrlAll.ts:43
getMemberPolicyUrlAll#
▸ getMemberPolicyUrlAll<T
>(resourceWithAcr
): UrlString
[]
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Get the URLs of policies applying to the given resource’s children.
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#
src/acp/policy/getMemberPolicyUrlAll.ts:42
getNoneOfMatcherUrlAll#
▸ getNoneOfMatcherUrlAll<P
>(policy
): UrlString
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the “None Of” [[Matcher]]s for the given [[Policy]]
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#
src/acp/matcher.ts:301
getPolicy#
▸ getPolicy(policyResource
, url
): Policy
| null
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the [[Policy]] with the given URL from an [[SolidDataset]].
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#
src/acp/policy.ts:119
getPolicyAll#
▸ getPolicyAll(policyResource
): Policy
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get all [[Policy]]’s in a given [[SolidDataset]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains Access Policies. |
Returns#
Policy
[]
Since
1.6.0
Defined in#
src/acp/policy.ts:141
getPolicyUrlAll#
▸ getPolicyUrlAll(resourceWithAcr
): UrlString
[]
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Get the URLs of policies applying to the given resource.
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#
src/acp/policy/getPolicyUrlAll.ts:42
getReferencedPolicyUrlAll#
▸ getReferencedPolicyUrlAll(withAcr
): UrlString
[]
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
To make it easy to fetch all the relevant Access Policy Resources, this function returns all referenced Access Policy Resources referenced in an Access Control Resource. In other words, if Access Controls refer to different Policies in the same Access Policy Resource, this function will only return that Access Policy Resource’s URL once.
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#
src/acp/acp.ts:403
getResourceAcrPolicy#
▸ getResourceAcrPolicy(resourceWithAcr
, name
): ResourcePolicy
| null
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the [[ResourcePolicy]] with the given name that applies to a Resource’s Access Control Resource from that Access Control Resource.
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#
src/acp/policy.ts:497
getResourceAcrPolicyAll#
▸ getResourceAcrPolicyAll(resourceWithAcr
): ResourcePolicy
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get all [[ResourcePolicy]]’s that apply to a given Resource’s Access Control Resource from that Access Control Resource.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies. |
Returns#
ResourcePolicy
[]
Since
1.6.0
Defined in#
src/acp/policy.ts:551
getResourceInfoWithAccessDatasets#
▸ getResourceInfoWithAccessDatasets(url
, options?
): Promise
<WithServerResourceInfo
& WithAcp
| WithAcl
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Fetch information about a Resource, and:
if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.
if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:236
getResourceInfoWithAcr#
▸ getResourceInfoWithAcr(url
, options?
): Promise
<WithServerResourceInfo
& WithAcp
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Retrieve information about a Resource and its associated Access Control Resource (if available to the current user), without fetching the Resource itself.
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:126
getResourceMatcher#
▸ getResourceMatcher(resourceWithAcr
, name
): ResourceMatcher
| null
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the [[ResourceMatcher]] with the given name from an Resource’s Access Control Resource.
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#
src/acp/matcher.ts:383
getResourceMatcherAll#
▸ getResourceMatcherAll(resourceWithAcr
): ResourceMatcher
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Gets the [[ResourceMatcher]]s from a Resource’s Access Control Resource.
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#
src/acp/matcher.ts:425
getResourcePolicy#
▸ getResourcePolicy(resourceWithAcr
, name
): ResourcePolicy
| null
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get the [[ResourcePolicy]] with the given name that applies to a Resource from its Access Control Resource.
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#
src/acp/policy.ts:464
getResourcePolicyAll#
▸ getResourcePolicyAll(resourceWithAcr
): ResourcePolicy
[]
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Get all [[ResourcePolicy]]’s that apply to a Resource in its Access Control Resource.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains Access Policies applying to it. |
Returns#
ResourcePolicy
[]
Since
1.6.0
Defined in#
src/acp/policy.ts:528
getSolidDatasetWithAccessDatasets#
▸ getSolidDatasetWithAccessDatasets(url
, options?
): Promise
<SolidDataset
& WithAcp
| WithAcl
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Fetch a SolidDataset, and:
if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.
if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:160
getSolidDatasetWithAcr#
▸ getSolidDatasetWithAcr(url
, options?
): Promise
<SolidDataset
& WithServerResourceInfo
& WithAcp
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Fetch a SolidDataset and its associated Access Control Resource (if available to the current user).
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:67
getVcAccess#
▸ getVcAccess(resourceWithAcr
): AccessModes
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Get the maximum access modes that are allowed for a VC holder for a given resource. If the resource owner issued an Access Grant for the resource, the agent that has been granted access will have at most the permissions returned by this function. The Access Grant may be more restrictive.
Note that only the modes set using [[setVcAccess]] will be returned by this function. Additional access may have been set if the ACR has been manipulated not using this library, which is currently out of scope.
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#
src/acp/util/getVcAccess.ts:75
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#
src/acp/acp.ts:309
hasAuthenticated#
▸ hasAuthenticated(matcher
): boolean
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Check if the Matcher applies to any authenticated agent.
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#
src/acp/matcher.ts:695
hasCreator#
▸ hasCreator(matcher
): boolean
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Check if the Matcher applies to the creator of the Resource.
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#
src/acp/matcher.ts:752
hasLinkedAcr#
▸ hasLinkedAcr<Resource
>(resource
): resource is WithLinkedAcr<Resource>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Given a Resource, check whether it is governed by Access Policies. (Specifically, a Resource that is governed by Access Policies will refer to exactly one Access Control Resource, and expose that to users who are allowed to see or modify access to the given Resource.)
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#
src/acp/control.ts:69
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#
src/acp/matcher.ts:639
isAcpControlled#
▸ isAcpControlled(resource
, options?
): Promise
<boolean
>
Verify whether the access to the given resource is controlled using the ACP system.
Parameters#
Name |
Type |
Default value |
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#
src/acp/acp.ts:424
mockAcrFor#
▸ mockAcrFor(resourceUrl
): AccessControlResource
Warning
Do not use this function in production code. For use in unit tests that require a [[AccessControlResource]].
Initialises a new empty Access Control Resource for a given Resource for use in unit tests.
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#
src/acp/mock.ts:43
removeAcrPolicyUrl#
▸ removeAcrPolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Remove a policy applying to the ACR of the given resource.
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#
src/acp/policy/removeAcrPolicyUrl.ts:45
removeAcrPolicyUrlAll#
▸ removeAcrPolicyUrlAll<ResourceExt
>(resourceWithAcr
): ResourceExt
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Stop all URL of Access Policies from applying to an Access Control Resource itself.
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#
src/acp/control.ts:302
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#
src/acp/matcher.ts:624
removeAllOfMatcherUrl#
▸ removeAllOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Removes a Matcher that refines the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.
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#
src/acp/matcher.ts:104
removeAnyOfMatcherUrl#
▸ removeAnyOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Removes a Matcher that extends the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.
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#
src/acp/matcher.ts:183
removeAuthenticated#
▸ removeAuthenticated(matcher
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set a Matcher to no longer apply to any authenticated Agent.
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#
src/acp/matcher.ts:737
removeClient#
▸ removeClient(matcher
, client
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Prevent the [[Matcher]] from applying to a given Client directly.
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#
src/acp/matcher.ts:869
removeCreator#
▸ removeCreator(matcher
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set a Matcher to no longer apply to the creator of a Resource.
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#
src/acp/matcher.ts:793
removeMatcher#
▸ removeMatcher<Dataset
>(matcherResource
, matcher
): Dataset
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Removes the given [[Matcher]] from the given [[SolidDataset]].
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#
src/acp/matcher.ts:444
removeMemberAcrPolicyUrl#
▸ removeMemberAcrPolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Remove a policy applying to the ACRs of the given resource’s children.
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#
src/acp/policy/removeMemberAcrPolicyUrl.ts:45
removeMemberAcrPolicyUrlAll#
▸ removeMemberAcrPolicyUrlAll<ResourceExt
>(resourceWithAcr
): ResourceExt
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Stop all URL of Access Policies from applying to the Access Control Resources of the Resource’s children.
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#
src/acp/control.ts:330
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#
src/acp/policy/removeMemberPolicyUrl.ts:45
removeMemberPolicyUrlAll#
▸ removeMemberPolicyUrlAll<ResourceExt
>(resourceWithAcr
): ResourceExt
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Stop all URL of Access Policies from applying to the Resource’s children.
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#
src/acp/control.ts:531
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#
src/acp/matcher.ts:263
removePolicy#
▸ removePolicy<Dataset
>(policyResource
, policy
): Dataset
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Remove the given [[Policy]] from the given [[SolidDataset]].
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#
src/acp/policy.ts:160
removePolicyUrl#
▸ removePolicyUrl<T
>(resourceWithAcr
, policyUrl
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Remove a policy applying to the given resource.
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#
src/acp/policy/removePolicyUrl.ts:45
removePolicyUrlAll#
▸ removePolicyUrlAll<ResourceExt
>(resourceWithAcr
): ResourceExt
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Stop all URL of Access Policies from applying to a Resource.
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#
src/acp/control.ts:506
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#
src/acp/matcher.ts:680
removeResourceAcrPolicy#
▸ removeResourceAcrPolicy<ResourceExt
>(resourceWithAcr
, policy
): ResourceExt
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Remove the given [[ResourcePolicy]] that applies to a given Resource’s Access Control Resource from that Access Control Resource.
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#
src/acp/policy.ts:628
removeResourceMatcher#
▸ removeResourceMatcher<ResourceExt
>(resourceWithAcr
, matcher
): ResourceExt
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Removes the given [[ResourceMatcher]] from the given Resource’s Access Control Resource.
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#
src/acp/matcher.ts:462
removeResourcePolicy#
▸ removeResourcePolicy<ResourceExt
>(resourceWithAcr
, policy
): ResourceExt
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Remove the given [[ResourcePolicy]] from the given Resource’s Access Control Resource.
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#
src/acp/policy.ts:575
saveAcrFor#
▸ saveAcrFor<ResourceExt
>(resource
, options?
): Promise
<ResourceExt
>
Note
The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.
Save a Resource’s Access Control Resource.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Default value |
Description |
---|---|---|---|
|
|
|
Resource with an Access Control Resource that should be saved. |
|
|
|
Optional parameter |
Returns#
Promise
<ResourceExt
>
Since
1.6.0
Defined in#
src/acp/acp.ts:268
setAgent#
▸ setAgent(matcher
, agent
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Overwrite the agents the [[Matcher]] applies to with the provided agents.
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#
src/acp/matcher.ts:575
setAllOfMatcherUrl#
▸ setAllOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Overwrites the Matcher refining the scope of a given the [[Policy]]. If an agent requesting access to a resource is not present in any of the “All Of” Matchers, they will not be granted access.
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#
src/acp/matcher.ts:124
setAllowModes#
▸ setAllowModes<P
>(policy
, modes
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Given a [[Policy]] and a set of [[AccessModes]], return a new Policy based on the given Policy, but with the given Access Modes allowed on it.
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#
src/acp/policy.ts:198
setAnyOfMatcherUrl#
▸ setAnyOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Overwrite the Matcher extending the scope of a given the [[Policy]]. If an agent requesting access to a resource is present in any of the “Any Of” Matchers, they will be granted access.
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#
src/acp/matcher.ts:203
setAuthenticated#
▸ setAuthenticated(matcher
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set a Matcher to apply to any authenticated Agent.
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#
src/acp/matcher.ts:714
setCreator#
▸ setCreator(matcher
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set a Matcher to apply to the creator of a Resource.
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#
src/acp/matcher.ts:770
setDenyModes#
▸ setDenyModes<P
>(policy
, modes
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Given a [[Policy]] and a set of [[AccessModes]], return a new Policy based on the given Policy, but with the given Access Modes disallowed on it.
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#
src/acp/policy.ts:320
setMatcher#
▸ setMatcher<Dataset
>(matcherResource
, matcher
): Dataset
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Insert the given [[Matcher]] into the given [[SolidDataset]], replacing previous instances of that Matcher.
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#
src/acp/matcher.ts:513
setNoneOfMatcherUrl#
▸ setNoneOfMatcherUrl<P
>(policy
, matcher
): P
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set the Matchers restricting the scope of a given [[Policy]]. If an agent requesting access to a resource is matched by another Matcher, but also by any of the “None Of” Matchers, they will not be granted access.
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#
src/acp/matcher.ts:284
setPolicy#
▸ setPolicy<Dataset
>(policyResource
, policy
): Dataset
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Insert the given [[Policy]] into the given [[SolidDataset]], replacing previous instances of that Policy.
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#
src/acp/policy.ts:179
setPublic#
▸ setPublic(matcher
): Matcher
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Set a Matcher to apply to any Agent.
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#
src/acp/matcher.ts:657
setResourceMatcher#
▸ setResourceMatcher<ResourceExt
>(resourceWithAcr
, matcher
): ResourceExt
Note
There is no Access Control Policies specification yet. As such, this function is still experimental and subject to change, even in a non-major release.
Insert the given [[ResourceMatcher]] into the given Resource’s Access Control Resource, replacing previous instances of that Matcher.
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#
src/acp/matcher.ts:532
setResourcePolicy#
▸ setResourcePolicy<T
>(resourceWithAcr
, policy
): T
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Insert the given [[ResourcePolicy]] into the given Resource’s Acccess Control Resource, replacing previous instances of that Policy.
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#
src/acp/policy/setResourcePolicy.ts:41
setVcAccess#
▸ setVcAccess(resourceWithAcr
, access
, options?
): WithAccessibleAcr
Note
The ACP specification is a draft. As such, this function is experimental and subject to change, even in a non-major release. See also: https://solid.github.io/authorization-panel/acp-specification/
Set the maximum access modes that are allowed for a VC holder for a given resource. If the resource owner issued an Access Grant for the resource, the agent that has been granted access will have at most the permissions set by this function. The Access Grant may be more restrictive.
Note that additional access may have been set if the ACR has been manipulated not using this library, which is currently out of scope. In this case, the access set by this function may not apply.
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
Defined in#
src/acp/util/setVcAccess.ts:103