Rust

[Roles]: lists of role strings.

Contents

use utopia_database::validator::roles::Roles;
Rust
pub struct Roles

A list of role strings (any, user:<id>, team:<id>/<role>, ...), at most length of them (0: no limit), each starting with one of the allowed names and well formed for its role.

Rust
use utopia_database::validator::roles::Roles;
use utopia_database::value::{list, string};

let roles = Roles::default();
assert!(roles.is_valid(&list([string("any"), string("user:123")])));
assert!(!roles.is_valid(&list([string("user")])));
assert_eq!(roles.description(), "Role \"user\" must have an ID value.");
Also implements Default.
Rust
pub const ROLES: [&str; 7] = ["any", "guests", "users", "user", "team", "member", "label"]

Undocumented.

Rust
pub const USER_DIMENSIONS: [&str; 2] = ["verified", "unverified"]

Roles::USER_DIMENSIONS: the dimensions of users and user roles.