MindLake.Permission
In Mind Lake, users can access others' data, but private encrypted data is presented as ciphertext. To share private data with a specific user, the data owner must grant the target user permission to decrypt the ciphertext, thereby enabling access to the plaintext.
During testing, only existing users of Mind Lake can be designated as targets for permission sharing.
1. grant() Method
Grant decryption permissions to the recipient to enable them to access the encrypted data in the specified columns.
When the Grant
method is called by a grantor for the same recipient again, the existing grant policy from the grantor to the recipient is overwritten. The previous policy becomes invalid immediately, and the new policy, which includes the new set of columns, takes effect only after the recipient invokes the Confirm
method for this grant policy.
Parameters
targetWalletAddress
-str
: the wallet address of the recipientcolumns
-list<str>
: the columns to be shared with the recipient. Each column should be defined as a string that combines the table name, and column name, separated by dots. Specifically, the format for defining a column should be"TableName.ColumnName"
Returns
An object of . For more information.
data
-str
: the UUID string of the grant policy. The granter should share this UUID with the recipient. The recipient then needs to confirm the policy for it to take effect.
Example
2. confirm() Method
Confirm the grant policy as the recipient. The policy will take effect after the confirmation.
Parameters
policyID -
str
: the UUID string of the grant policy. The recipient should get it from the granter.
Returns
An object of . For more information.
Example
3. revoke() Method
Revoke decryption permissions for the target user. Consequently, the target user loses access to all the encrypted data belonging to the owner who invokes this method.
Parameters
targetWalletAddress
-str
: the wallet address of the target whose permission is to be revoked.
Returns
An object of . For more information.
Example
4. listGrantee() Method
Retrieve a list of wallet addresses of users who have been granted permission by the invoking user.
Returns
An object of . For more information.
data
-list<str>
: a list of wallet addresses of users who have been granted permission by the invoking user.
Example
5. listOwner() Method
Retrieve a list of wallet addresses of users who have granted permission to the invoking user.
Returns
An object of . For more information.
data
-list<str>
: a list of wallet addresses of users who have granted permission to the invoking user.
Example
6. listGrantedColumn() Method
Retrieve a list of column names for which decryption permission has been granted to the specified user.
Parameters
targetWalletAddress
-str
: specify the target user by the wallet address.
Returns
An object of . For more information.
data
-list<str>
: a list of column names for which decryption permission has been granted to the specified user.
Example
7. listOwnerColumn() Method
Retrieve a list of column names authorized for decryption by the specified user.
Parameters
targetWalletAddress
-str
: specify the owner user of the authorized columns by the wallet address.
Returns
An object of . For more information.
data
-list<str>
: a list of column names authorized for decryption by the specified user.
Example
Last updated