rust-rbac 0.1.0

A flexible Role-Based Access Control (RBAC) system for Rust applications
Documentation
use thiserror::Error;

/// Errors that can occur in the RBAC system
#[derive(Error, Debug)]
pub enum RbacError {
    #[error("Permission not found: {0}")]
    PermissionNotFound(String),
    
    #[error("Role not found: {0}")]
    RoleNotFound(String),
    
    #[error("Subject not found: {0}")]
    SubjectNotFound(String),
    
    #[error("Storage error: {0}")]
    StorageError(String),
    
    #[error("Permission already exists: {0}")]
    PermissionAlreadyExists(String),
    
    #[error("Role already exists: {0}")]
    RoleAlreadyExists(String),
    
    #[error("Invalid operation: {0}")]
    InvalidOperation(String),
    
    #[error("Database error: {0}")]
    DatabaseError(String),
    
    #[error("Unauthorized: Missing required permission {0}")]
    MissingPermission(String),
    
    #[error("Unauthorized: Missing required role {0}")]
    MissingRole(String),
}