fabaccess-bffh/bffhd/capnp/permissionsystem.rs

25 lines
508 B
Rust
Raw Normal View History

use crate::authorization::roles::Role;
use crate::Roles;
use capnp::capability::Promise;
use capnp::Error;
2022-06-24 13:57:47 +02:00
use tracing::Span;
2022-03-15 20:00:43 +01:00
2022-03-12 17:31:53 +01:00
use crate::session::SessionHandle;
2022-06-24 13:57:47 +02:00
const TARGET: &str = "bffh::api::permissionsystem";
pub struct Permissions {
2022-06-24 13:57:47 +02:00
span: Span,
roles: Roles,
}
2022-03-12 17:31:53 +01:00
impl Permissions {
pub fn new(session: SessionHandle) -> Self {
2022-06-24 13:57:47 +02:00
let span = tracing::info_span!(target: TARGET, "PermissionSystem",);
Self {
2022-06-24 13:57:47 +02:00
span,
roles: session.roles,
}
2022-03-12 17:31:53 +01:00
}
}