Skip to main content

createRole(roleName, roleId, seed)

Create a new role in the peaq network’s Role-Based Access Control (RBAC) system.

Create Role Code Examples

The EVM tx it returns in a different form than what was used throughout the sdk. The purpose of this is to show the role-id that was autogenerated if it was not manually set.

fetchRole(owner, roleId, wssBaseUrl)

Fetch a role at the given roleId and address associated.

Fetch Role Code Examples

fetchRoles(owner, wssBaseUrl)

Used to fetch all the roles associated with the passed owner address.

Fetch Roles Code Examples

updateRole(roleName, roleId, seed)

Allows the owner to update the role name.

Update Role Code Examples

disableRole(roleId, seed)

Disables a role within a permission management system.

Disable Role Code Examples

assignRoleToUser(userId, roleId, seed)

This function allows you to assign a specific role to a user in a permission management system.

Assign Role to User Code Examples

fetchUserRoles(owner, userId, wssBaseUrl)

Designed to retrieve roles associated with a specific user from the network’s RBAC (Role-Based Access Control) system.

Fetch User Roles Code Examples

unassignRoleToUser(userId, roleId, seed)

This function allows you to unassign a specific role from a user in a permission management system.

Unassign Role to User Code Examples