Skip to main content

create_permission(permission_name, permission_id)

Used to create a new permission within the RBAC (Role-Based Access Control) system.

Create Permission Code Examples

fetch_permission(owner, permission_id)

Used to fetch a permission in the RBAC system by its permission ID.

Fetch Permission Code Examples

fetch_permissions(owner)

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

Fetch Permissions Code Examples

update_permission(permission_id, permission_name)

Updates the name of an existing permission.

Update Permission Code Examples

disable_permission(permission_id)

Disables a permission within the RBAC system. A disabled permission cannot be used for new role assignments.

Disable Permission Code Examples

assign_permission_to_role(permission_id, role_id)

Assigns a permission to a role, granting the role the capabilities defined by the permission.

Assign Permission to Role Code Examples

fetch_role_permissions(owner, role_id)

Fetches all permissions assigned to a role.

Fetch Role Permissions Code Examples

unassign_permission_to_role(permission_id, role_id)

Removes a permission from a role, revoking the role’s access to the permission’s capabilities.

Unassign Permission from Role Code Examples

fetch_user_permissions(owner, user_id)

Fetches all permissions assigned to a user (via roles). In order to fetch a user permission the following flow must take place:
  1. Assign permission to role
  2. Assign role to user
  3. Fetch user permissions
The following code shows this flow.

Fetch User Permissions Code Examples

fetch_group_permissions(owner, group_id)

Fetches all permissions assigned to a group (via roles). In order to fetch a group permission the following flow must take place:
  1. Assign permission to role
  2. Assign role to group
  3. Fetch group permissions
The following code shows this flow.

Fetch Group Permissions Code Examples