pub async fn list_permissions(pool: &Pool<MySql>) -> Result<Vec<Permission>>
Expand description
Retrieves all permissions in the system, ordered by ID.
This function fetches all permission records from the database, providing a complete view of all defined permissions in the system. The results are ordered by ID in ascending order, which typically reflects the order in which permissions were created.
§Arguments
pool
- Database connection pool for executing the query
§Returns
Ok(Vec<Permission>)
- Successfully retrieved list of permissionsErr(anyhow::Error)
- Failed to fetch permissions
§Use Cases
Common use cases include:
- Administrative interfaces for permission management
- Permission assignment interfaces when configuring roles
- System audit and compliance reporting