create_permission(permission_name, permission_id)
Used to create a new permission within the RBAC (Role-Based Access Control) system.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
permission_name | str | Required | Required | Name of the permission to be created. |
permission_id | Optional[str] | Optional | Optional | ID of the permission (32 characters). If not supplied one will be generated for you. |
Create Permission Code Examples
fetch_permission(owner, permission_id)
Used to fetch a permission in the RBAC system by its permission ID.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner of the permission. |
permission_id | str | Required | Required | ID of the permission to be fetched. |
Fetch Permission Code Examples
fetch_permissions(owner)
Used to fetch all permissions associated with the passed owner address.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address that represents the owner of all the fetched permissions. |
Fetch Permissions Code Examples
update_permission(permission_id, permission_name)
Updates the name of an existing permission.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
permission_id | str | Required | Required | ID of the permission to update (32 characters). |
permission_name | str | Required | Required | New name for the 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.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
permission_id | str | Required | Required | ID of the permission to disable (32 characters). |
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.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
permission_id | str | Required | Required | ID of the permission to assign (32 characters). |
role_id | str | Required | Required | ID of the role to assign the permission to (32 characters). |
Assign Permission to Role Code Examples
fetch_role_permissions(owner, role_id)
Fetches all permissions assigned to a role.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner. |
role_id | str | Required | Required | ID of the role to fetch permissions for (32 characters). |
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.Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
permission_id | str | Required | Required | ID of the permission to unassign (32 characters). |
role_id | str | Required | Required | ID of the role to unassign the permission from (32 characters). |
Unassign Permission from Role Code Examples
fetch_user_permissions(owner, user_id)
Fetches all permissions assigned to a user (via roles).Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner. |
user_id | str | Required | Required | ID of the user to fetch permissions for (32 characters). |
- Assign permission to role
- Assign role to user
- Fetch user permissions
Fetch User Permissions Code Examples
fetch_group_permissions(owner, group_id)
Fetches all permissions assigned to a group (via roles).Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
owner | str | Required | Required | Address representing the owner. |
group_id | str | Required | Required | ID of the group to fetch permissions for (32 characters). |
- Assign permission to role
- Assign role to group
- Fetch group permissions