@inrupt/solid-client / acp/rule
Module: acp/rule¶
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
, agent
): 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 |
---|---|---|
|
The Rule to be applied to an additional agent. |
|
|
|
The agent the Rule should apply to. |
Returns¶
A copy of the Rule, applying to an additional agent.
Defined in¶
src/acp/rule.ts:610
addAllOfRuleUrl¶
▸ addAllOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
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
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
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
, client
): 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 |
---|---|---|
|
The Rule to be applied to an additional Client. |
|
|
|
The Client the Rule should apply to. |
Returns¶
A copy of the Rule, applying to an additional Client.
Defined in¶
src/acp/rule.ts:921
addGroup¶
▸ addGroup(rule
, group
): 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
deprecated
Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The Rule to be applied to an additional group. |
|
|
|
- |
Returns¶
A copy of the Rule, applying to an additional group.
Defined in¶
src/acp/rule.ts:677
addNoneOfRuleUrl¶
▸ addNoneOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
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
, name
): 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 |
---|---|---|
|
The Resource to which the new Rule is to apply. |
|
|
|
Name that identifies this Rule. |
Returns¶
Defined in¶
src/acp/rule.ts:336
createRule¶
▸ createRule(url
): 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 that identifies this Rule. |
Returns¶
Defined in¶
src/acp/rule.ts:318
getAgentAll¶
▸ getAgentAll(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 |
---|---|---|
|
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
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the rules should be read. |
Returns¶
A list of the “All Of” Rules
Defined in¶
src/acp/rule.ts:144
getAnyOfRuleUrlAll¶
▸ getAnyOfRuleUrlAll<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” Rules for the given Policy
since
1.6.0
Type parameters¶
Name |
Type |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the rules should be read. |
Returns¶
A list of the “Any Of” Rules
Defined in¶
src/acp/rule.ts:223
getClientAll¶
▸ getClientAll(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 |
---|---|---|
|
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:879
getGroupAll¶
▸ getGroupAll(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
deprecated
Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule from which groups are read. |
Returns¶
A list of the [[URL]]’s of groups included in the rule.
Defined in¶
src/acp/rule.ts:643
getNoneOfRuleUrlAll¶
▸ getNoneOfRuleUrlAll<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” Rules for the given Policy
since
1.6.0
Type parameters¶
Name |
Type |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The [[policy]] from which the rules should be read. |
Returns¶
A list of the forbidden Rules
Defined in¶
src/acp/rule.ts:302
getResourceRule¶
▸ getResourceRule(resourceWithAcr
, name
): 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 |
---|---|---|
|
The Resource whose Access Control Resource contains the given ResourceRule. |
|
|
|
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
): 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 |
---|---|---|
|
The Resource whose Access Control Resource contains (zero or more) ResourceRules. |
Returns¶
The ResourceRules contained in this Resource’s Access Control Resource.
Defined in¶
src/acp/rule.ts:426
getRule¶
▸ getRule(ruleResource
, url
): 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 |
---|---|---|
|
|
The Resource that contains the given Rule. |
|
|
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
): 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 |
---|---|---|
|
|
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
): 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 |
---|---|---|
|
The rule checked for authenticated access. |
Returns¶
boolean
Whether the rule applies to public clients.
Defined in¶
src/acp/rule.ts:953
hasAuthenticated¶
▸ hasAuthenticated(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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule checked for authenticated access. |
Returns¶
boolean
Whether the rule applies to any authenticated agent or not.
Defined in¶
src/acp/rule.ts:765
hasCreator¶
▸ hasCreator(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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
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:822
hasPublic¶
▸ hasPublic(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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule checked for public access. |
Returns¶
boolean
Whether the rule applies to any agent or not.
Defined in¶
src/acp/rule.ts:709
removeAgent¶
▸ removeAgent(rule
, agent
): 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 |
---|---|---|
|
The Rule that should no longer apply to a given agent. |
|
|
|
The agent the rule should no longer apply to. |
Returns¶
A copy of the rule, not applying to the given agent.
Defined in¶
src/acp/rule.ts:627
removeAllOfRuleUrl¶
▸ removeAllOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy from which the rule should be removed. |
|
|
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
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 |
---|---|---|
|
The rule for which clients are set. |
Returns¶
A copy of the rule, updated to no longer apply to any client
Defined in¶
src/acp/rule.ts:987
removeAnyOfRuleUrl¶
▸ removeAnyOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy from which the rule should be removed. |
|
|
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
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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to apply/not apply to any authenticated agent.
Defined in¶
src/acp/rule.ts:807
removeClient¶
▸ removeClient(rule
, client
): 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 |
---|---|---|
|
The Rule that should no longer apply to a given Client. |
|
|
|
The Client the rule should no longer apply to. |
Returns¶
A copy of the rule, not applying to the given Client.
Defined in¶
src/acp/rule.ts:937
removeCreator¶
▸ removeCreator(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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to apply/not apply to the creator of a Resource.
Defined in¶
src/acp/rule.ts:863
removeGroup¶
▸ removeGroup(rule
, group
): 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
deprecated
Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The Rule that should no longer apply to a given group. |
|
|
|
- |
Returns¶
A copy of the rule, not applying to the given group.
Defined in¶
src/acp/rule.ts:694
removeNoneOfRuleUrl¶
▸ removeNoneOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy from which the rule should be removed. |
|
|
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
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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to no longer apply to any agent.
Defined in¶
src/acp/rule.ts:750
removeResourceRule¶
▸ removeResourceRule<ResourceExt
>(resourceWithAcr
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains (zero or more) ResourceRules. |
|
|
- |
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
, 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains (zero or more) Rules. |
|
|
- |
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
): 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 |
---|---|---|
|
The Rule to get a human-readable representation of. |
Returns¶
string
Defined in¶
src/acp/rule.ts:1000
setAgent¶
▸ setAgent(rule
, agent
): 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 |
---|---|---|
|
The rule for which agents are set. |
|
|
|
The agent the rule should apply to. |
Returns¶
A copy of the input rule, applying to a different set of agents.
Defined in¶
src/acp/rule.ts:578
setAllOfRuleUrl¶
▸ setAllOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
- |
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
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 |
---|---|---|
|
The rule for which clients are set. |
Returns¶
A copy of the rule, updated to apply to any client
Defined in¶
src/acp/rule.ts:972
setAnyOfRuleUrl¶
▸ setAnyOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
- |
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
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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to apply to any authenticated Agent.
Defined in¶
src/acp/rule.ts:784
setClient¶
▸ setClient(rule
, client
): 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 |
---|---|---|
|
The rule for which clients are set. |
|
|
|
The Client the rule should apply to. |
Returns¶
A copy of the input rule, applying to a different set of Clients.
Defined in¶
src/acp/rule.ts:897
setCreator¶
▸ setCreator(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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to apply to the creator of a Resource.
Defined in¶
src/acp/rule.ts:840
setGroup¶
▸ setGroup(rule
, group
): 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
deprecated
Access Control Policies will no longer support vcard:Group. You can re-use a Rule listing multiple Agents to get the same functionality.
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule for which groups are set. |
|
|
|
The group the rule should apply to. |
Returns¶
A copy of the input rule, applying to a different set of groups.
Defined in¶
src/acp/rule.ts:660
setNoneOfRuleUrl¶
▸ setNoneOfRuleUrl<P
>(policy
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Policy to which the rule should be added. |
|
|
- |
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
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.
since
1.6.0
Parameters¶
Name |
Type |
Description |
---|---|---|
|
The rule being modified. |
Returns¶
A copy of the rule, updated to apply to any agent.
Defined in¶
src/acp/rule.ts:727
setResourceRule¶
▸ setResourceRule<ResourceExt
>(resourceWithAcr
, rule
): 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Resource whose Access Control Resource contains (zero or more) ResourceRules. |
|
- |
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
, 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 |
---|---|
|
extends |
Parameters¶
Name |
Type |
Description |
---|---|---|
|
|
The Resource that contains (zero or more) Rules. |
|
- |
Returns¶
Dataset
A new SolidDataset equal to the given Rule Resource, but with the given Rule.
Defined in¶
src/acp/rule.ts:515