// Copyright (c) 2026 Kirky.X
//
// Licensed under the MIT License
// See LICENSE file in the project root for full license information.

//! RbacProvider 单元测试

#[cfg(test)]
mod tests {
    use dbnexus::permission::provider::{PermissionContext, PermissionProvider};
    use dbnexus::permission::rbac::RbacProvider;

    #[tokio::test]
    async fn test_rbac_allow() {
        let provider = RbacProvider::new();
        let context = PermissionContext {
            subject: "admin".to_string(),
            resource: "users".to_string(),
            action: "SELECT".to_string(),
        };
        let decision = provider.check_permission(&context).await;
        assert_eq!(decision, dbnexus::permission::provider::PermissionDecision::Allow);
    }
}
