dialtone_common 0.1.0

Dialtone Common Code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{ap::id::parse_actors_host, rest::users::web_user::SystemRole};

use super::{host::authz_on_host, user_authz_info::UserAuthzInfo};

pub fn authz_actor_on_host(
    user_authz_info: &UserAuthzInfo,
    role: &SystemRole,
    actor_id: &str,
) -> bool {
    let host_name = parse_actors_host(actor_id);
    if host_name.is_err() {
        false
    } else {
        authz_on_host(user_authz_info, role, &host_name.unwrap())
    }
}