- solidAPI.acl
Class for working with ACL using an aclAgents object
- aclModes
const aclModes = ['Read', 'Append', 'Write', 'Control']
- aclAccesses
const aclAccesses = ['accessTo', 'default']
- aclPredicates
const aclPredicates = ['agent', 'agentClass', 'agentGroup', 'origin', 'default']
aclObject is a string, aclPredicates related :
- agent: webId, bot, application, ...
- agentClass: 'Agent'
- agentGroup: URI
- origin: origin url
- default: '' (blank string)
- aclMode(itemUrl, aclContent, options)
Check if a user or everybody has an auth
- checkAcl(itemUrl, aclContent, options)
Class for working with ACL using an aclAgents object
Kind: global class
- solidAPI.acl
- .contentParser(url, aclcontent) ⇒
object
|array
- .createContent(url, aclAgents, options) ⇒
string
- .addUserMode(aclAgents, userAgent, userMode, userAccess) ⇒
object
- .deleteUserMode(aclAgents, userAgent, userMode, userAccess) ⇒
object
- .makeContentRelative(aclcontent, itemUrl, toName, options)
- .isValidAcl(itemUrl, content, options)
- .isValidRDF(itemUrl, content, options)
- .contentParser(url, aclcontent) ⇒
aclcontent parser
Kind: instance method of solidAPI.acl
Returns: object
| array
- aclAgents Object or Array of Objects
Param | Type | Description |
---|---|---|
url | string |
resource |
aclcontent | string |
of url.acl |
create turtle aclcontent for url resource from aclAgents object
Kind: instance method of solidAPI.acl
Returns: string
- text/turtle aclContent
Param | Type | Description |
---|---|---|
url | string |
ressource (not url.acl) |
aclAgents | object | array |
object or Array of objects |
options | object |
for isValidAcl() |
Properties
Name | Type | Description |
---|---|---|
'may' | options.aclDefault |
('must' is more prudent) |
'Control' | options.aclMode |
|
if | options.URI |
used check that at least this URI has 'Control' |
modify aclAgents object by adding agents and/or modes and/or access types
Kind: instance method of solidAPI.acl
Returns: object
- aclAgents
Param | Type | Description |
---|---|---|
aclAgents | object |
|
userAgent | array |
array of objects { aclPredicate: aclObject } |
userMode | array |
['Read'] |
userAccess | array |
Properties
Name | Type | Description |
---|---|---|
default | userAccess |
value ['accessTo', 'default'] |
modify aclAgents object by removing agents and/or modes
Kind: instance method of solidAPI.acl
Returns: object
- aclAgents
Param | Type | Description |
---|---|---|
aclAgents | object |
|
userAgent | array |
array of objects { aclPredicate: aclObject } |
userMode | array |
['Read'] |
userAccess | array |
['accessTo', 'default'] |
Make aclContent relative to url resource
- make absolute paths relative to folder
- make relative paths to pod relative to folder
- update relative paths to the new location
Kind: instance method of solidAPI.acl
Param | Type | Description |
---|---|---|
aclcontent | string |
|
itemUrl | string |
resource url (not an url.acl) |
toName | string |
destination name ('' or file name) |
options | object |
for agent |
check that atleast an agent type has control and that the acl is well-formed URI is usually the webId checked to have 'Control' authorization aclDefault: 'may' (spec compliant), if 'must' then one acl: Default is needed for folder ACL aclAuth 'must' : spec compliant acl: Authorization is mandatory
Kind: instance method of solidAPI.acl
Result: object
{ err: [blocking errors], info: [non blocking anomalies]}
Param | Type |
---|---|
itemUrl | string |
content | string |
options | object |
Properties
Name | Type |
---|---|
'Control' | options.aclMode |
'must' | options.aclAuth |
'may' | options.aclDefault |
is valid RDF (parses with N3.js)
Kind: instance method of solidAPI.acl
Param | Type |
---|---|
itemUrl | string |
content | string |
options | object |
Properties
Name | Type | Description |
---|---|---|
default | options.baseIRI |
to itemUrl |
none | 'text/n3' | options.format |
const aclModes = ['Read', 'Append', 'Write', 'Control']
const aclAccesses = ['accessTo', 'default']
const aclPredicates = ['agent', 'agentClass', 'agentGroup', 'origin', 'default']
aclObject is a string, aclPredicates related :
- agent: webId, bot, application, ...
- agentClass: 'Agent'
- agentGroup: URI
- origin: origin url
- default: '' (blank string)
Check if a user or everybody has an auth
Kind: global function
Param | Type |
---|---|
itemUrl | string |
aclContent | string |
options | object |
Properties
Name | Type | Description |
---|---|---|
'Control' | options.aclMode |
by default |
check | options.URI |
for 'Control' for a single URI : person, group, .... |
Kind: global function
Param | Type |
---|---|
itemUrl | string |
aclContent | string |
options | object |