@inrupt/solid-client / acp/rule

Module: acp/rule

Table of contents

Type aliases

Functions

Type aliases

ResourceRule

Ƭ ResourceRule: ThingPersisted

A ResourceRule is like a Rule, but applied to a ResourcePolicy and therefore not re-used across different Resources, but only used for a single Resource and stored in that Resource’s Access Control Resource.

since 1.6.0

Defined in: src/acp/rule.ts:59


Rule

Ƭ Rule: ThingPersisted

A Rule can be applied to a Policy to determine under what circumstances that Policy is applied to a Resource.

since 1.6.0

Defined in: src/acp/rule.ts:54

Functions

addAgent

addAgent(rule: Rule, agent: WebId): Rule

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 Rule to an additional agent.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule to be applied to an additional agent.

agent

WebId

The agent the Rule should apply to.

Returns: Rule

A copy of the Rule, applying to an additional agent.

Defined in: src/acp/rule.ts:610


addAllOfRuleUrl

addAllOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule 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” rules, they will not be granted access.

Also see addAnyOfRuleUrl and addNoneOfRuleUrl.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

The rule to add to the policy.

Returns: P

A new Policy clone of the original one, with the new rule added.

Defined in: src/acp/rule.ts:87


addAnyOfRuleUrl

addAnyOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule 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” rules, they will be granted access.

Also see addAllOfRuleUrl and addNoneOfRuleUrl.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

The rule to add to the policy.

Returns: P

A new Policy clone of the original one, with the new rule added.

Defined in: src/acp/rule.ts:166


addClient

addClient(rule: Rule, client: WebId): Rule

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 Rule to an additional Client.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule to be applied to an additional Client.

client

WebId

The Client the Rule should apply to.

Returns: Rule

A copy of the Rule, applying to an additional Client.

Defined in: src/acp/rule.ts:917


addGroup

addGroup(rule: Rule, group: UrlString): Rule

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 Rule to an additional group.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule to be applied to an additional group.

group

UrlString

-

Returns: Rule

A copy of the Rule, applying to an additional group.

Defined in: src/acp/rule.ts:674


addNoneOfRuleUrl

addNoneOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule that restricts the scope of a given the Policy. If an agent requesting access to a resource is present in any of the forbidden rules, they will not be granted access.

Also see addAllOfRuleUrl and addAnyOfRuleUrl.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

The rule to add to the policy.

Returns: P

A new Policy clone of the original one, with the new rule added.

Defined in: src/acp/rule.ts:245


createResourceRuleFor

createResourceRuleFor(resourceWithAcr: WithAccessibleAcr, name: string): ResourceRule

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 ResourceRule for the given Resource.

since 1.6.0

Parameters:

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource to which the new Rule is to apply.

name

string

Name that identifies this Rule.

Returns: ResourceRule

Defined in: src/acp/rule.ts:336


createRule

createRule(url: Url | UrlString): Rule

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 Rule.

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL that identifies this Rule.

Returns: Rule

Defined in: src/acp/rule.ts:318


getAgentAll

getAgentAll(rule: Rule): 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 Rule applies directly to. This will not include agents that are part of a group the Rule applies to, nor will it include specific agent classes, such as authenticated or public agents.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule from which agents are read.

Returns: WebId[]

A list of the WebIDs of agents included in the rule.

Defined in: src/acp/rule.ts:557


getAllOfRuleUrlAll

getAllOfRuleUrlAll<P>(policy: P): 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” Rules for the given Policy

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The [[policy]] from which the rules should be read.

Returns: UrlString[]

A list of the “All Of” Rules

Defined in: src/acp/rule.ts:144


getAnyOfRuleUrlAll

getAnyOfRuleUrlAll<P>(policy: P): 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” Rules for the given Policy

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The [[policy]] from which the rules should be read.

Returns: UrlString[]

A list of the “Any Of” Rules

Defined in: src/acp/rule.ts:223


getClientAll

getClientAll(rule: Rule): 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 Rule applies directly to. This will not include specific client classes, such as public clients.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule from which clients are read.

Returns: WebId[]

A list of the WebIDs of clients included in the rule.

Defined in: src/acp/rule.ts:875


getGroupAll

getGroupAll(rule: Rule): 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.

Lists all the groups a Rule applies to.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule from which groups are read.

Returns: UrlString[]

A list of the [[URL]]’s of groups included in the rule.

Defined in: src/acp/rule.ts:642


getNoneOfRuleUrlAll

getNoneOfRuleUrlAll<P>(policy: P): 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” Rules for the given Policy

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The [[policy]] from which the rules should be read.

Returns: UrlString[]

A list of the forbidden Rules

Defined in: src/acp/rule.ts:302


getResourceRule

getResourceRule(resourceWithAcr: WithAccessibleAcr, name: string): ResourceRule | 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 ResourceRule with the given name from an Resource’s Access Control Resource.

since 1.6.0

Parameters:

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains the given ResourceRule.

name

string

Name that identifies this ResourceRule.

Returns: ResourceRule | null

The requested ResourceRule, if it exists, or null if it does not.

Defined in: src/acp/rule.ts:384


getResourceRuleAll

getResourceRuleAll(resourceWithAcr: WithAccessibleAcr): ResourceRule[]

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 ResourceRules from a Resource’s Access Control Resource.

since 1.6.0

Parameters:

Name

Type

Description

resourceWithAcr

WithAccessibleAcr

The Resource whose Access Control Resource contains (zero or more) ResourceRules.

Returns: ResourceRule[]

The ResourceRules contained in this Resource’s Access Control Resource.

Defined in: src/acp/rule.ts:426


getRule

getRule(ruleResource: SolidDataset, url: Url | UrlString): Rule | 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 Rule with the given URL from an SolidDataset.

since 1.6.0

Parameters:

Name

Type

Description

ruleResource

SolidDataset

The Resource that contains the given Rule.

url

Url | UrlString

URL that identifies this Rule.

Returns: Rule | null

The requested Rule, if it exists, or null if it does not.

Defined in: src/acp/rule.ts:360


getRuleAll

getRuleAll(ruleResource: SolidDataset): Rule[]

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 Rules from a SolidDataset.

since 1.6.0

Parameters:

Name

Type

Description

ruleResource

SolidDataset

The Resource that contains (zero or more) Rules.

Returns: Rule[]

The Rules contained in this resource.

Defined in: src/acp/rule.ts:410


hasAnyClient

hasAnyClient(rule: Rule): 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 rule applies to any client, i.e. all the applications regardless of their identifier.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule checked for authenticated access.

Returns: boolean

Whether the rule applies to public clients.

Defined in: src/acp/rule.ts:949


hasAuthenticated

hasAuthenticated(rule: Rule): 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 rule applies to any authenticated agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule checked for authenticated access.

Returns: boolean

Whether the rule applies to any authenticated agent or not.

Defined in: src/acp/rule.ts:761


hasCreator

hasCreator(rule: Rule): 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 rule applies to the creator of the Resource.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule checked for authenticated access.

Returns: boolean

Whether the rule applies to the creator of the Resource or not.

Defined in: src/acp/rule.ts:818


hasPublic

hasPublic(rule: Rule): 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 rule applies to any agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule checked for public access.

Returns: boolean

Whether the rule applies to any agent or not.

Defined in: src/acp/rule.ts:705


removeAgent

removeAgent(rule: Rule, agent: WebId): Rule

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 Rule from applying to a given agent directly. This will not remove the agent from any groups the rule applies to.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule that should no longer apply to a given agent.

agent

WebId

The agent the rule should no longer apply to.

Returns: Rule

A copy of the rule, not applying to the given agent.

Defined in: src/acp/rule.ts:627


removeAllOfRuleUrl

removeAllOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule 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” rules, they will not be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy from which the rule should be removed.

rule

Rule | Url | UrlString

The rule to remove from the policy.

Returns: P

A new Policy clone of the original one, with the rule removed.

Defined in: src/acp/rule.ts:107


removeAnyClient

removeAnyClient(rule: Rule): Rule

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.

Make the Rule no longer apply to any client application.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule for which clients are set.

Returns: Rule

A copy of the rule, updated to no longer apply to any client

Defined in: src/acp/rule.ts:983


removeAnyOfRuleUrl

removeAnyOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule 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” rules, they will be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy from which the rule should be removed.

rule

Rule | Url | UrlString

The rule to remove from the policy.

Returns: P

A new Policy clone of the original one, with the rule removed.

Defined in: src/acp/rule.ts:186


removeAuthenticated

removeAuthenticated(rule: Rule): Rule

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 Rule to no longer apply to any authenticated Agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to apply/not apply to any authenticated agent.

Defined in: src/acp/rule.ts:803


removeClient

removeClient(rule: Rule, client: WebId): Rule

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 Rule from applying to a given Client directly.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule that should no longer apply to a given Client.

client

WebId

The Client the rule should no longer apply to.

Returns: Rule

A copy of the rule, not applying to the given Client.

Defined in: src/acp/rule.ts:933


removeCreator

removeCreator(rule: Rule): Rule

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 Rule to no longer apply to the creator of a Resource.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to apply/not apply to the creator of a Resource.

Defined in: src/acp/rule.ts:859


removeGroup

removeGroup(rule: Rule, group: UrlString): Rule

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 Rule from applying to a given group.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The Rule that should no longer apply to a given group.

group

UrlString

-

Returns: Rule

A copy of the rule, not applying to the given group.

Defined in: src/acp/rule.ts:690


removeNoneOfRuleUrl

removeNoneOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule that restricts the scope of a given the Policy. If an agent requesting access to a resource is present in any of the forbidden rules, they will not be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy from which the rule should be removed.

rule

Rule | Url | UrlString

The rule to remove from the policy.

Returns: P

A new Policy clone of the original one, with the rule removed.

Defined in: src/acp/rule.ts:265


removePublic

removePublic(rule: Rule): Rule

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 Rule to no longer apply to any Agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to no longer apply to any agent.

Defined in: src/acp/rule.ts:746


removeResourceRule

removeResourceRule<ResourceExt>(resourceWithAcr: ResourceExt, rule: string | Url | UrlString | ResourceRule): 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 ResourceRule from the given Resource’s Access Control Resource.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains (zero or more) ResourceRules.

rule

string | Url | UrlString | ResourceRule

-

Returns: ResourceExt

A new Resource equal to the given Resource, but without the given Rule in its ACR.

Defined in: src/acp/rule.ts:463


removeRule

removeRule<Dataset>(ruleResource: Dataset, rule: Url | UrlString | Rule): 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 Rule from the given SolidDataset.

since 1.6.0

Type parameters:

Name

Type

Dataset

DatasetCore<Quad, Quad, Dataset>

Parameters:

Name

Type

Description

ruleResource

Dataset

The Resource that contains (zero or more) Rules.

rule

Url | UrlString | Rule

-

Returns: Dataset

A new SolidDataset equal to the given Rule Resource, but without the given Rule.

Defined in: src/acp/rule.ts:445


ruleAsMarkdown

ruleAsMarkdown(rule: Rule): string

Gets a human-readable representation of the given Rule 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

rule

Rule

The Rule to get a human-readable representation of.

Returns: string

Defined in: src/acp/rule.ts:996


setAgent

setAgent(rule: Rule, agent: WebId): Rule

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 Rule applies to with the provided agents.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule for which agents are set.

agent

WebId

The agent the rule should apply to.

Returns: Rule

A copy of the input rule, applying to a different set of agents.

Defined in: src/acp/rule.ts:578


setAllOfRuleUrl

setAllOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule 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” rules, they will not be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

-

Returns: P

A new Policy clone of the original one, with the “All Of” rules replaced.

Defined in: src/acp/rule.ts:127


setAnyClient

setAnyClient(rule: Rule): Rule

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.

Make the Rule apply to any client application.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule for which clients are set.

Returns: Rule

A copy of the rule, updated to apply to any client

Defined in: src/acp/rule.ts:968


setAnyOfRuleUrl

setAnyOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rule extending the scope of a given the Policy. If an agent requesting access to a resource is present in any of the “Any Of” rules, they will be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

-

Returns: P

A new Policy clone of the original one, with the “Any Of” rules replaced.

Defined in: src/acp/rule.ts:206


setAuthenticated

setAuthenticated(rule: Rule): Rule

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 Rule to apply to any authenticated Agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to apply to any authenticated Agent.

Defined in: src/acp/rule.ts:780


setClient

setClient(rule: Rule, client: WebId): Rule

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 clients the Rule applies to with the provided Client.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule for which clients are set.

client

WebId

The Client the rule should apply to.

Returns: Rule

A copy of the input rule, applying to a different set of Clients.

Defined in: src/acp/rule.ts:893


setCreator

setCreator(rule: Rule): Rule

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 Rule to apply to the creator of a Resource.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to apply to the creator of a Resource.

Defined in: src/acp/rule.ts:836


setGroup

setGroup(rule: Rule, group: UrlString): Rule

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 groups the Rule applies to with the provided groups.

since 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule for which groups are set.

group

UrlString

The group the rule should apply to.

Returns: Rule

A copy of the input rule, applying to a different set of groups.

Defined in: src/acp/rule.ts:658


setNoneOfRuleUrl

setNoneOfRuleUrl<P>(policy: P, rule: Rule | Url | UrlString): 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 rules restrincting the scope of a given the Policy. If an agent requesting access to a resource is present in any of the “None Of” rules, they will not be granted access.

since 1.6.0

Type parameters:

Name

Type

P

ThingPersisted

Parameters:

Name

Type

Description

policy

P

The Policy to which the rule should be added.

rule

Rule | Url | UrlString

-

Returns: P

A new Policy clone of the original one, with the “Any Of” rules replaced.

Defined in: src/acp/rule.ts:285


setPublic

setPublic(rule: Rule): Rule

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 Rule to apply to any Agent.

status 1.6.0

Parameters:

Name

Type

Description

rule

Rule

The rule being modified.

Returns: Rule

A copy of the rule, updated to apply to any agent.

Defined in: src/acp/rule.ts:723


setResourceRule

setResourceRule<ResourceExt>(resourceWithAcr: ResourceExt, rule: ResourceRule): 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 ResourceRule into the given Resource’s Access Control Resource, replacing previous instances of that Rule.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resourceWithAcr

ResourceExt

The Resource whose Access Control Resource contains (zero or more) ResourceRules.

rule

ResourceRule

-

Returns: ResourceExt

A new Resource equal to the given Resource, but with the given Rule in its ACR.

Defined in: src/acp/rule.ts:534


setRule

setRule<Dataset>(ruleResource: Dataset, rule: Rule): 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 Rule into the given SolidDataset, replacing previous instances of that Rule.

since 1.6.0

Type parameters:

Name

Type

Dataset

DatasetCore<Quad, Quad, Dataset>

Parameters:

Name

Type

Description

ruleResource

Dataset

The Resource that contains (zero or more) Rules.

rule

Rule

-

Returns: Dataset

A new SolidDataset equal to the given Rule Resource, but with the given Rule.

Defined in: src/acp/rule.ts:515