> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Permissions

Define and assign permissions to roles.

```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
from peaq_robot import PeaqRobot

sdk = PeaqRobot()

# Create a permission
p1 = sdk.access.create_permission("ROBOT_CONTROL", "Full Robot Control Access")
print("create_permission:", p1)

# Assign permission to a role
arp = sdk.access.assign_permission_to_role("ROBOT_CONTROL", "ROBOT_OPERATOR")
print("assign_permission_to_role:", arp)

# Read permission (may be unavailable depending on chain)
print(sdk.access.read_permission("ROBOT_CONTROL"))
```

Expected output (abridged):

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
create_permission: 0x7795a3cff2c33e60...
assign_permission_to_role: 0x9b060b42f3d206e9...
{'exists': False, 'permission_name': 'ROBOT_CONTROL', 'permission_id': '0x524f424f545f434f4e54524f4c30303030303030303030303030303030303030'}
```
