Group
createGroup Tx
Create a new group without group members on Greenfield blockchain, and group members can be added by updateGroupMember transaction.
A Group
is a collection of accounts that share the same permissions, allowing them to be handled
as a single entity.
Examples of permissions include:
Put
,List
,Get
,Delete
,Copy
, andExecute
data objects;Create
,Delete
, andList
bucketsCreate
,Delete
,ListMembers
,Leave groups
Create
,Associate payment accounts
Grant
,Revoke
the above permissions
For more details regarding Group
, please refer to permisson.
params | description |
---|---|
creator | the account address of group owner who create the group |
groupName | the name of the group. it's not globally unique |
extra | extra info for the group |
example
const tx = await client.group.createGroup({
creator: '0x00..',
groupName: 'group_name',
extra: 'extra_info',
});
deleteGroup Tx
Delete a group on Greenfield blockchain. The sender MUST only be the group owner, group members or others would fail to send this transaction.
warning
Deleting a group will result in granted permission revoked. Members within the group will no longer have access to resources (bucket, object) which granted permission on.
params | description |
---|---|
operator | the account address of the operator who has the DeleteGroup permission of the group to be deleted |
groupName | the name of the group which to be deleted |
example
const tx = await client.group.deleteGroup({
groupName: 'group_name',
operator: '0x00..',
});
getBucketPolicyOfGroup Query
Queries a bucket of policy that grants permission to a group.
params | description |
---|---|
bucketName | bucket name |
groupId | group id |
example
await client.group.getBucketPolicyOfGroup('bucket_name', 1);