@inrupt/solid-client / acp/control

Module: acp/control

Table of contents

Type aliases

Functions

Type aliases

AccessControlResource

Ƭ AccessControlResource: SolidDataset & WithResourceInfo & { accessTo: 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.

An Access Control Resource, containing Controls specifying which Policy’s apply to the Resource this Access Control Resource is linked to.

since 1.6.0

Defined in: src/acp/control.ts:98


Control

Ƭ Control: Thing

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.

A Control, usually contained in an AccessControlResource. It describes which Policy’s apply to a Resource.

since 1.6.0

Defined in: src/acp/control.ts:110


WithLinkedAcr

Ƭ WithLinkedAcr<Resource>: Resource & { internal_resourceInfo: { linkedResources: { http://www.w3.org/ns/solid/acp#accessControl: [string] } } }

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.

If this type applies to a Resource, it is governed by an Access Control Resource, and thus not the Web Access Control spec. It does not indicate that this Access Control Resource will also be accessible to the current user.

since 1.6.0

Type parameters:

Name

Type

Default

Resource

WithServerResourceInfo

WithServerResourceInfo

Defined in: src/acp/control.ts:123

Functions

acrAsMarkdown

acrAsMarkdown(resourceWithAcr: WithResourceInfo & WithAccessibleAcr): string

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

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

since 1.6.0

Parameters:

Name

Type

Description

resourceWithAcr

WithResourceInfo & WithAccessibleAcr

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

Returns: string

Defined in: src/acp/control.ts:561


addAcrPolicyUrl

addAcrPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

policyUrl

Url | UrlString | ThingPersisted

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:146


addMemberAcrPolicyUrl

addMemberAcrPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

policyUrl

Url | UrlString | ThingPersisted

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:174


addMemberPolicyUrl

addMemberPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

policyUrl

Url | UrlString

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:388


addPolicyUrl

addPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource to which the ACR Policy should be added.

policyUrl

Url | UrlString

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:365


getAcrPolicyUrlAll

getAcrPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): UrlString[]

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: UrlString[]

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

Defined in: src/acp/control.ts:201


getMemberAcrPolicyUrlAll

getMemberAcrPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): UrlString[]

Note

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

Get the URLs of the Access Policies that apply to the Access Control Resources of the Resource’s children.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: UrlString[]

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

Defined in: src/acp/control.ts:226


getMemberPolicyUrlAll

getMemberPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): UrlString[]

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: UrlString[]

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

Defined in: src/acp/control.ts:434


getPolicyUrlAll

getPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): UrlString[]

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: UrlString[]

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

Defined in: src/acp/control.ts:409


hasLinkedAcr

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

Note

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

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

since 1.6.0

Type parameters:

Name

Type

Resource

WithServerResourceInfo

Parameters:

Name

Type

Description

resource

Resource

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

Returns: resource is WithLinkedAcr<Resource>

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

Defined in: src/acp/control.ts:76


removeAcrPolicyUrl

removeAcrPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

Stop the URL of a given Policy from applying to an Access Control Resource itself.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource to which the given URL of a Policy should no longer apply.

policyUrl

Url | UrlString | ThingPersisted

The URL of the Policy that should no longer apply.

Returns: ResourceExt

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

Defined in: src/acp/control.ts:251


removeAcrPolicyUrlAll

removeAcrPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:309


removeMemberAcrPolicyUrl

removeMemberAcrPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

Stop the URL of a given Policy from applying to the Access Control Resources of the Resource’s children.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource to whose children’s ACRs the given URL of a Policy should no longer apply.

policyUrl

Url | UrlString | ThingPersisted

The URL of the Policy that should no longer apply.

Returns: ResourceExt

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

Defined in: src/acp/control.ts:281


removeMemberAcrPolicyUrlAll

removeMemberAcrPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:337


removeMemberPolicyUrl

removeMemberPolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

Stop the URL of a given Policy from applying to the Resource’s children.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource with the Access Control Resource to whose children the given URL of a Policy should no longer apply.

policyUrl

Url | UrlString | ThingPersisted

The URL of the Policy that should no longer apply.

Returns: ResourceExt

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

Defined in: src/acp/control.ts:487


removeMemberPolicyUrlAll

removeMemberPolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:538


removePolicyUrl

removePolicyUrl<ResourceExt>(resourceWithAcr: ResourceExt, policyUrl: Url | UrlString | ThingPersisted): ResourceExt

Note

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

Stop the URL of a given Policy from applying to a Resource.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource, with its Access Control Resource, to which the given URL of a Policy should no longer apply.

policyUrl

Url | UrlString | ThingPersisted

The URL of the Policy that should no longer apply.

Returns: ResourceExt

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

Defined in: src/acp/control.ts:460


removePolicyUrlAll

removePolicyUrlAll<ResourceExt>(resourceWithAcr: ResourceExt): ResourceExt

Note

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

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

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

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

Returns: ResourceExt

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

Defined in: src/acp/control.ts:513