create_group(group_name, group_id)
Used to create a new group within the RBAC (Role-Based Access Control) system.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
group_name | str | Required | Required | Name of the group to be created. |
group_id | str | Optional | Optional | ID of the group. If not provided, a new ID will be generated (32 characters). |
Create Group Code Examples
fetch_group(owner, group_id)
Fetches group information from the RBAC system based on the provided group ID and owner’s address.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner of the group. |
group_id | str | Required | Required | ID of the group to be fetched (32 characters). |
Fetch Group Code Examples
fetch_groups(owner)
Used to fetch all the groups associated with the passed owner address.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner of all the fetched groups. |
Fetch Groups Code Examples
update_group(group_id, group_name)
Allows updating the name of an existing group in the RBAC system.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
group_id | str | Required | Required | ID of the group to be updated (32 characters). |
group_name | str | Required | Required | New name for the group. |
Update Group Code Examples
disable_group(group_id)
Disables a group within the RBAC system. A disabled group cannot be used for new role assignments.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
group_id | str | Required | Required | ID of the group to be disabled (32 characters). |
Disable Group Code Examples
assign_role_to_group(group_id, role_id)
Assigns a role to a group in the RBAC system. This grants all members of the group the permissions associated with the role.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
group_id | str | Required | Required | ID of the group to assign the role to (32 characters). |
role_id | str | Required | Required | ID of the role to be assigned (32 characters). |
Assign Role to Group Code Examples
fetch_group_roles(owner, group_id)
Fetches all roles assigned to a specific group in the RBAC system.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address of the group owner. |
group_id | str | Required | Required | ID of the group to fetch roles from (32 characters). |
Fetch Group Roles Code Examples
unassign_role_to_group(group_id, role_id)
Removes a role assignment from a group in the RBAC system. This revokes the role’s permissions from all group members.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
group_id | str | Required | Required | ID of the group to unassign the role from (32 characters). |
role_id | str | Required | Required | ID of the role to be unassigned (32 characters). |
Unassign Role to Group Code Examples
assign_user_to_group(user_id, group_id)
Assigns a user to a group in the RBAC system. The user will inherit all roles and permissions assigned to the group.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
user_id | str | Required | Required | ID of the user to be assigned to the group (32 characters). |
group_id | str | Required | Required | ID of the group to assign the user to (32 characters). |
Assign User to Group Code Examples
fetch_user_groups(owner, user_id)
Fetches all groups that a specific user is assigned to in the RBAC system.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address of the group owner. |
user_id | str | Required | Required | ID of the user to fetch groups for (32 characters). |
Fetch User Groups Code Examples
unassign_user_to_group(user_id, group_id)
Removes a user from a group in the RBAC system. The user will lose all roles and permissions associated with the group.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
user_id | str | Required | Required | ID of the user to be unassigned from the group (32 characters). |
group_id | str | Required | Required | ID of the group to unassign the user from (32 characters). |