dacquiri 0.5.1

An authorization framework with compile-time enforcement.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use dacquiri::prelude::*;
use crate::{AuthorizationError, User};

#[attribute(Enabled)]
pub fn check_if_user_is_enabled(user: &User) -> AttributeResult<AuthorizationError> {
    if user.is_enabled() {
        Ok(())
    } else {
        Err(AuthorizationError::UserNotEnabled)
    }
}