fetchGrantedAccess
This method provides a listing of all access grants given for the specified protected data object. It supports several optional parameters to restrict the size of the result set. Options for filtering include specifying an authorized user, an application, or both. You may optionally receive the results as a paginated list.
Usage
The request object is a JSON FetchGrantedAccessParams object. Each address in the object is a String representation of an ethereum address or ENS name (Ethereum Name Service) reference.
Return value example
The return value for this method has two fields: a count
parameter indicating the number of results, and an array of GrantedAccess
objects containing all access data. When using the optional paging parameters, the count
will be limited by the selected pageSize
parameter. You may use these result objects in conjunction with the revokeOneAccess method to revoke a previously granted authorization for access.
Parameters
protectedData (required) Address of the protected data object for which you are querying access authorization grants. type - String representation of ethereum address or ENS name (Ethereum Name Service)
authorizedApp (optional)
Optional filter to restrict the results to include only authorizations for the specified application. type - String representation of ethereum address or ENS name (Ethereum Name Service)
If you specified an application whitelist when using grantAccess
, you must specify that same whitelist address when using this filtering option. The fetchGrantedAccess
method does not check against whitelist smart contracts when aggregating results. If you granted authorization to a whitelist but specify an application address for the authorizedApp
parameter, you will not receive any results unless you also explicitly granted access to that application address.
authorizedUser (optional)
Optional filter to restrict the results to include only authorizations for the specified user.
type - String representation of ethereum address or ENS name (Ethereum Name Service)
page (optional)
Specifies the results page to return. The default for this is 0
which returns all results. Pages are indexed starting at page 1. If using this field you may also specify a pageSize
to control the size of the results.
pageSize (optional)
Specifies the number of records in each page of the result set. This is used in conjunction with the optional page
parameter to constrain the size of the result. The default for this value is 20
but this only comes into play when specifying a page
parameter.
Result
This method returns an object with two fields:
count
An integer value indicating the number of results returned by this method. This is of particular note when using paging as the number of records returned may be smaller than the page size.
grantedAccess
This is an array of grantedAccess
objects. Each object has the following fields:
apprestrict - address of the authorized application; a value of 0x0 indicates any application may access this data
dataset - address of the protectedData
containing user data
datasetprice - price (in nRLC) to charge the user specified in requesterrestrict
for each use of this protectedData
requesterrestrict - address of the requester authorized to use this protectedData
in workloads; a value of 0x0 indicates any requester may use this data
volume - number of authorized uses of this protectedData
; each use decrements this counter
workerpoolrestrict- address of the decentralized infrastructure (worker pool) authorized to execute the application; a value of 0x0 indicates any worker pool may access this data
salt - random value to make an order unique and reusable as nonce in a blockchain transaction
sign - order signature of all the grantedAccess
fields
tag - defines whether a protectedData
is usable in a TEE environment (Trusted Execution Environment); 0x00
is TEE while 0x03
is non-TEE
Last updated