@inrupt/solid-client / acl/agent

Module: acl/agent#

Type Aliases#

AgentAccess#

Ƭ AgentAccess: Record<WebId, Access>

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.

Defined in#

src/acl/agent.ts:51

Functions#

getAgentAccess#

getAgentAccess(resourceInfo, agent): Access | null

Note

This function is still experimental and subject to change, even in a non-major release.

Returns an Agent’s explicitly-granted Access Modes for the given Resource.

The function does not return Access Modes granted indirectly to the Agent through other ACL rules, e.g., public or group-specific permissions.

Parameters#

Name

Type

Description

resourceInfo

WithAcl & WithResourceInfo & { }

Information about the Resource to which the given Agent may have been granted access.

agent

string

WebID of the Agent for which to retrieve what access it has to the Resource.

Returns#

Access | null

Access Modes that have been explicitly granted to the Agent for the given Resource, or null if it could not be determined (e.g. because the current user does not have Control access to a given Resource or its Container).

Defined in#

src/acl/agent.ts:67


getAgentAccessAll#

getAgentAccessAll(resourceInfo): AgentAccess | null

Note

This function is still experimental and subject to change, even in a non-major release.

Returns all explicitly-granted Access Modes per Agent for the given Resource.

The function does not return Access Modes granted indirectly to Agents through other ACL rules, e.g., public or group-specific permissions.

Parameters#

Name

Type

Description

resourceInfo

WithAcl & WithResourceInfo & { }

Information about the Resource to which Agents may have been granted access.

Returns#

AgentAccess | null

Access Modes per Agent that have been explicitly granted for the given Resource, or null if it could not be determined (e.g. because the current user does not have Control access to a given Resource or its Container).

Defined in#

src/acl/agent.ts:92


getAgentDefaultAccess#

getAgentDefaultAccess(aclDataset, agent): Access

Note

This function is still experimental and subject to change, even in a non-major release.

Returns an Agent’s Access Modes explicitly granted for the children of the Container associated with the given ACL (Access Control List).

The function does not return:

  • Access Modes granted indirectly to the Agent through other ACL rules, e.g. public or group-specific permissions.

  • Access Modes granted to the Agent for the Container Resource itself (see getAgentResourceAccess instead).

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains Access-Control List rules for a certain Container.

agent

string

WebID of the Agent for which to retrieve what access it has to the Container’s children.

Returns#

Access

Access Modes that have been explicitly granted to an Agent for the children of the Container associated with the given ACL.

Defined in#

src/acl/agent.ts:215


getAgentDefaultAccessAll#

getAgentDefaultAccessAll(aclDataset): AgentAccess

Note

This function is still experimental and subject to change, even in a non-major release.

Returns the Access Modes, per Agent, that have been explicitly granted for the children of the Container associated with the given ACL (Access Control List).

The function does not return:

  • Access Modes granted indirectly to the Agents through other ACL rules, e.g. public or group-specific permissions.

  • Access Modes granted to the Agents for the Container Resource itself (see getAgentResourceAccessAll instead).

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains Access-Control List rules.

Returns#

AgentAccess

Access Modes, per Agent, that have been explicitly granted for the children of the Container associated with the given ACL.

Defined in#

src/acl/agent.ts:245


getAgentResourceAccess#

getAgentResourceAccess(aclDataset, agent): Access

Note

This function is still experimental and subject to change, even in a non-major release.

Returns the Access Modes explicitly granted to an Agent for the Resource associated with an ACL (Access ControlList).

The function does not return:

  • Access Modes granted indirectly to the Agent through other ACL rules, e.g., public or group-specific permissions.

  • Access Modes granted to the Agent for the child Resources if the associated Resource is a Container (see getAgentDefaultAccess instead).

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains ACL rules.

agent

string

WebID of the Agent for which to retrieve what access it has to the Resource.

Returns#

Access

Access Modes that have been explicitly granted to an Agent for the Resource associated with an ACL SolidDataset.

Defined in#

src/acl/agent.ts:123


getAgentResourceAccessAll#

getAgentResourceAccessAll(aclDataset): AgentAccess

Note

This function is still experimental and subject to change, even in a non-major release.

Returns the explicitly granted Access Modes per Agent for the Resource associated with an ACL (Access Control List).

The function does not return:

  • Access Modes granted indirectly to Agents through other ACL rules, e.g., public or group-specific permissions.

  • Access Modes granted to Agents for the child Resources if the associated Resource is a Container.

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains ACL rules.

Returns#

AgentAccess

Access Modes per Agent that have been explicitly granted for the Resource associated with an ACL SolidDataset.

Defined in#

src/acl/agent.ts:153


setAgentDefaultAccess#

setAgentDefaultAccess(aclDataset, agent, access): AclDataset & WithChangeLog

Note

This function is still experimental and subject to change, even in a non-major release.

Modifies the default ACL (Access Control List) to set an Agent’s Access Modes for the Container’s children. Specifically, the function returns a new default ACL initialised with the given ACL and new rules for the Agent’s access.

If rules already exist for the Agent in the given ACL, in the returned ACL, they are replaced by the new rules.

This function does not modify:

  • Access Modes granted indirectly to the Agent through other ACL rules, e.g., public or group-specific permissions.

  • Access Modes granted to the Agent for the Container Resource itself.

  • The original ACL.

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains Access-Control List rules.

agent

string

The Agent to grant specific Access Modes.

access

Access

The Access Modes to grant to the Agent.

Returns#

AclDataset & WithChangeLog

A new default ACL initialised with the given aclDataset and access for the agent.

Defined in#

src/acl/agent.ts:277


setAgentResourceAccess#

setAgentResourceAccess(aclDataset, agent, access): AclDataset & WithChangeLog

Note

This function is still experimental and subject to change, even in a non-major release.

Modifies the resource ACL (Access Control List) to set the Access Modes for the given Agent. Specifically, the function returns a new resource ACL initialised with the given ACL and new rules for the Agent’s access.

If rules for Agent’s access already exist in the given ACL, in the returned ACL, they are replaced by the new rules.

This function does not modify:

  • Access Modes granted indirectly to Agents through other ACL rules, e.g., public or group-specific permissions.

  • Access Modes granted to Agents for the child Resources if the associated Resource is a Container.

  • The original ACL.

Parameters#

Name

Type

Description

aclDataset

AclDataset

The SolidDataset that contains Access-Control List rules.

agent

string

The Agent to grant specific Access Modes.

access

Access

The Access Modes to grant to the Agent for the Resource.

Returns#

AclDataset & WithChangeLog

A new resource ACL initialised with the given aclDataset and access for the agent.

Defined in#

src/acl/agent.ts:185