ObjectAuthorization
Handles fine-grained authorization for object relations.
Grants control who can initiate (from
) or accept (to
) object-to-object relations,
scoped by direction, relation ID, kind, and set.
Functions
grantFrom
Issues a grant to allow initiating relations from a tail object
Parameters
Name | Type | Description |
---|---|---|
tail | uint128 | Tail object ID |
grant | RelationGrant | Grant details |
revokeFrom
Revokes a previously issued from
grant
Parameters
Name | Type | Description |
---|---|---|
tail | uint128 | Tail object ID |
grantId | uint32 | Grant ID to revoke |
grantTo
Issues a grant to allow accepting relations to a head object
Parameters
Name | Type | Description |
---|---|---|
head | uint128 | Head object ID |
grant | RelationGrant | Grant details |
revokeTo
Revokes a previously issued to
grant
Parameters
Name | Type | Description |
---|---|---|
head | uint128 | Head object ID |
grantId | uint32 | Grant ID to revoke |
allowFrom
Checks whether a sender is authorized to initiate a relation from a tail object
Parameters
Name | Type | Description |
---|---|---|
grantId | uint32 | Grant ID to check |
sender | address | Address attempting the action |
tail | uint128 | Tail object ID |
rel | uint64 | Relation ID |
headKind | uint64 | Kind ID of the target (head) object |
headSet | uint64 | Set ID of the target (head) object |
Returns
Name | Type | Description |
---|---|---|
allowed | bool | True if authorized |
allowTo
Checks whether a sender is authorized to accept a relation to a head object
Parameters
Name | Type | Description |
---|---|---|
grantId | uint32 | Grant ID to check |
sender | address | Address attempting the action |
head | uint128 | Head object ID |
rel | uint64 | Relation ID |
tailKind | uint64 | Kind ID of the source (tail) object |
tailSet | uint64 | Set ID of the source (tail) object |
Returns
Name | Type | Description |
---|---|---|
allowed | bool | True if authorized |
Events
GrantFrom
Emitted when a grant is issued to authorize initiating a relation from a tail object
Parameters
Name | Type | Description |
---|---|---|
tail | uint128 | Tail object ID (initiator) |
grant | RelationGrant | Grant definition |
RevokeFrom
Emitted when a grant from a tail object is revoked
Parameters
Name | Type | Description |
---|---|---|
tail | uint128 | Tail object ID (initiator) |
grantId | uint32 | ID of the revoked grant |
GrantTo
Emitted when a grant is issued to authorize accepting a relation to a head object
Parameters
Name | Type | Description |
---|---|---|
head | uint128 | Head object ID (receiver) |
grant | RelationGrant | Grant definition |
RevokeTo
Emitted when a grant to a head object is revoked
Parameters
Name | Type | Description |
---|---|---|
head | uint128 | Head object ID (receiver) |
grantId | uint32 | ID of the revoked grant |