Skip to main content

createPermission(permissionName, permissionId, address, seed)

Creates a new permission in the RBAC (Role-Based Access Control) system.

Create Permission Code Examples

createPermission returns the transaction together with the permissionId, as createRole and createGroup do with their IDs; the other write calls return the transaction alone. That is how you read back an ID the SDK generated for you.

fetchPermission(owner, permissionId, wssBaseUrl)

Fetch a permission at the given permissionId and address.

Fetch Permission Code Examples

fetchPermissions(owner, wssBaseUrl)

Fetches every permission owned by the given address.

Fetch Permissions Code Examples

updatePermission(permissionName, permissionId, address, seed)

Allows the owner to update the permission name.

Update Permission Code Examples

disablePermission(permissionId, address, seed)

Disables a permission.

Disable Permission Code Examples

assignPermissionToRole(permissionId, roleId, address, seed)

Assigns a permission to a role.

Assign Permission to Role Code Examples

fetchRolePermissions(owner, roleId, wssBaseUrl)

Fetches the permissions assigned to a role.

Fetch Role Permissions Code Examples

unassignPermissionToRole(permissionId, roleId, address, seed)

Removes a permission from a role.

Unassign Permission from Role Code Examples

fetchUserPermissions(owner, userId, wssBaseUrl)

Fetches the permissions associated with a user. In order to fetch a user permission the following flow must take place:
  1. Create permission
  2. Create role
  3. Assign permission to role
  4. Assign role to user
  5. Fetch user permissions
The following code shows this flow.

Fetch User Permissions Code Examples

fetchGroupPermissions(owner, groupId, wssBaseUrl)

Fetches the permissions associated with a group. In order to fetch a group permission the following flow must take place:
  1. Create permission
  2. Create role
  3. Assign permission to role
  4. Create group
  5. Assign role to group
  6. Fetch group permissions
The following code shows this flow.

Fetch Group Permissions Code Examples