spawn-access-control 0.1.12

A Rust library for access control management with WebAssembly support, including role-based access control (RBAC), permissions, and audit logging.
Documentation
use redis::{Client, Commands};

pub struct DistributedAccessManager {
    redis_client: Client,
    local_cache: OptimizedCache,
}

impl DistributedAccessManager {
    pub async fn check_distributed_access(&self, user: &str, resource: &str) -> Result<bool, RedisError> {
        // İlk önce local cache'e bak
        if let Some(result) = self.local_cache.get(user) {
            return Ok(result);
        }
        
        // Redis'ten kontrol et
        let result: bool = self.redis_client.get(format!("access:{}:{}", user, resource))?;
        Ok(result)
    }
}