@inrupt/solid-client

Globals / “acl/acl”

Module: “acl/acl”

Functions

createAcl

createAcl(targetResource: WithResourceInfo & WithAccessibleAcl): AclDataset

Defined in src/acl/acl.ts:184

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.

Creates an empty resource ACL (Access Control List) for a given Resource.

Parameters:

Name

Type

Description

targetResource

WithResourceInfo & WithAccessibleAcl

A Resource that does not have its own ACL yet (see hasResourceAcl).

Returns: AclDataset

An empty resource ACL for the given Resource.


createAclFromFallbackAcl

createAclFromFallbackAcl(resource: WithFallbackAcl & WithResourceInfo & WithAccessibleAcl): AclDataset

Defined in src/acl/acl.ts:212

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.

Creates a resource ACL (Access Control List), initialised from the fallback ACL inherited from the given Resource’s Container (or another of its ancestor Containers). That is, the new ACL has the same rules/entries as the fallback ACL that currently applies to the Resource.

Parameters:

Name

Type

Description

resource

WithFallbackAcl & WithResourceInfo & WithAccessibleAcl

A Resource without its own resource ACL (see hasResourceAcl) but with an accessible fallback ACL (see hasFallbackAcl).

Returns: AclDataset

A resource ACL initialised with the rules/entries from the Resource’s fallback ACL.


deleteAclFor

deleteAclFor<Resource>(resource: Resource, options?: Partial<typeof internal_defaultFetchOptions>): Promise<Resource & { acl: { resourceAcl: null } }>

Defined in src/acl/acl.ts:291

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.

Removes the resource ACL (Access Control List) from a Resource.

Once the resource ACL is removed from the Resource, the Resource relies on the fallback ACL inherited from the Resource’s parent Container (or another of its ancestor Containers).

Type parameters:

Name

Type

Resource

WithResourceInfo & WithAccessibleAcl

Parameters:

Name

Type

Default value

Description

resource

Resource

-

The Resource for which you want to delete the ACL.

options

Partial<typeof internal_defaultFetchOptions>

internal_defaultFetchOptions

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

Returns: Promise<Resource & { acl: { resourceAcl: null } }>


getFallbackAcl

getFallbackAcl(resource: WithFallbackAcl): AclDataset

Defined in src/acl/acl.ts:165

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.

Returns the fallback ACL (Access Control List) attached to a Resource.

If the Resource has a fallback ACL attached and is accessible by the user (see hasFallbackAcl), the function returns the fallback ACL. If the Resource does not hava a fallback ACL attached or is inaccessible by the user, the function returns null.

Parameters:

Name

Type

Description

resource

WithFallbackAcl

A Resource with potentially a fallback ACL attached.

Returns: AclDataset

The fallback ACL if available or null if not.

getFallbackAcl(dataset: WithAcl): AclDataset | null

Defined in src/acl/acl.ts:166

Parameters:

Name

Type

dataset

WithAcl

Returns: AclDataset | null


getResourceAcl

getResourceAcl(resource: WithAcl & WithServerResourceInfo & WithResourceAcl): AclDataset

Defined in src/acl/acl.ts:107

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.

Returns the resource ACL (Access Control List) attached to a Resource.

If the Resource has its resource ACL attached and is accessible by the user (see hasResourceAcl), the function returns the resource ACL. If the Resource does not have a resource ACL attached or is inaccessible by the user, the function returns null.

Parameters:

Name

Type

Description

resource

WithAcl & WithServerResourceInfo & WithResourceAcl

A Resource with potentially an ACL attached.

Returns: AclDataset

The resource ACL if available and null if not.

getResourceAcl(resource: WithAcl & WithServerResourceInfo): AclDataset | null

Defined in src/acl/acl.ts:110

Parameters:

Name

Type

resource

WithAcl & WithServerResourceInfo

Returns: AclDataset | null


hasAcl

hasAcl<T>(dataset: T): dataset is T & WithAcl

Defined in src/acl/acl.ts:58

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.

Verify whether a given SolidDataset was fetched together with its Access Control List.

Type parameters:

Name

Type

T

object

Parameters:

Name

Type

Description

dataset

T

A SolidDataset that may have its ACLs attached.

Returns: dataset is T & WithAcl

True if dataset was fetched together with its ACLs.


hasFallbackAcl

hasFallbackAcl<Resource>(resource: Resource): resource is Resource & WithFallbackAcl

Defined in src/acl/acl.ts:144

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.

Verifies whether the given Resource has a fallback ACL (Access Control List) attached.

A fallback ACL for a Resource is inherited from the Resource’s parent Container (or another of its ancestor Containers) and applies if the Resource does not have its own resource ACL.

The hasFallbackAcl function checks that:

  • a given Resource has a fallback ACL attached, and

  • the user calling hasFallbackAcl has Control access to the Container from which the Resource inherits its ACL.

To retrieve a Resource with its ACLs, see getSolidDatasetWithAcl.

Type parameters:

Name

Type

Resource

WithAcl

Parameters:

Name

Type

Description

resource

Resource

A SolidDataset that might have a fallback ACL attached.

Returns: resource is Resource & WithFallbackAcl

true if the Resource has a fallback ACL attached that is accessible to the user.


hasResourceAcl

hasResourceAcl<Resource>(resource: Resource): resource is Resource & WithResourceAcl & WithAccessibleAcl

Defined in src/acl/acl.ts:79

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.

Verifies whether the given Resource has a resource ACL (Access Control List) attached.

The hasResourceAcl function checks that:

  • a given Resource has a resource ACL attached, and

  • the user calling hasResourceAcl has Control access to the Resource.

To retrieve a Resource with its ACLs, see getSolidDatasetWithAcl.

Type parameters:

Name

Type

Resource

WithAcl & WithServerResourceInfo

Parameters:

Name

Type

Description

resource

Resource

A Resource that might have an ACL attached.

Returns: resource is Resource & WithResourceAcl & WithAccessibleAcl

true if the Resource has a resource ACL attached that is accessible by the user.


saveAclFor

saveAclFor(resource: WithAccessibleAcl, resourceAcl: AclDataset, options?: Partial<typeof internal_defaultFetchOptions>): Promise<AclDataset & WithResourceInfo>

Defined in src/acl/acl.ts:249

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.

Saves the resource ACL for a Resource.

Parameters:

Name

Type

Default value

Description

resource

WithAccessibleAcl

-

The Resource to which the given resource ACL applies.

resourceAcl

AclDataset

-

An AclDataset whose ACL Rules will apply to resource.

options

Partial<typeof internal_defaultFetchOptions>

internal_defaultFetchOptions

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

Returns: Promise<AclDataset & WithResourceInfo>