slave 0.13.1

CLI for slave, a Laravel-inspired Rust framework for MCP-first apps: scaffold an MCP backend with auth, roles, teams and SurrealDB migrations, add server-rendered web apps, and route them by domain or path
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use surrealdb::types::SurrealValue;

/// A named set of permissions (`role:<id>`), such as `super_admin` or `user`.
/// Users hold roles through `user_role:[user_id, role_id]` records.
#[derive(Debug, Clone, SurrealValue)]
pub struct Role {
    pub id: i64,
    pub name: String,
}

impl Role {
    /// What to select for this struct: every field, with the numeric `id`,
    /// e.g. `SELECT {FIELDS} FROM role WHERE ...`.
    pub const FIELDS: &str = "*, record::id(id) AS id";
}