Using Licenses
Each license type has a unique address. This address is used when applying a license to a node in the ContentGraph.
NOTE: Licenses can only be attached and configured by a user acting on behalf of the owner of the corresponding node.
The ContentGraph has two methods that take this address as input:
setAccessAuth(bytes32 id, address accessAuth)
: sets a license from its address to be used to authenticate access.setReferenceAuth(bytes32 id, address referenceAuth)
: sets a license from its address to be used to authenticate the creation of a reference node of the asset.
Once a license has been attached it needs to be configured. See each license page for specific details on configuration.
Delegation of Auth for Access and reference
It is not a requirement for each node to be licensed. The ContentGraph is based on ERC6150 (opens in a new tab) which means that the structure of nodes in the graph are hierarchial.
If a node does not have a license set, it will delegate to it's parent node.
The auth delegation can be explained by the following pseudocode:
function auth(node, user, rejected=false):
accessAuth = accessAuth of node
parent = parent of node
if accessAuth is not set:
if parent is not set:
return not rejected
else:
return auth with parent, user, rejected
else:
authorized = call auth on license with id, user
if authorized:
return true
else:
if parent is root:
return false
return auth with parent, user, true
This delegation allows for a variety of configurations, broad licensing high in the ContentGraph, or fine grained licenses on each Asset node.