fabaccess-bffh/bffhd/capnp/permissionsystem.rs

32 lines
646 B
Rust
Raw Permalink Normal View History

use crate::authorization::roles::Role;
use crate::Roles;
2022-11-04 17:25:17 +01:00
use api::permissions_capnp::permissions::{
self, ListRolesParams, ListRolesResults,
};
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
}
}
2022-11-04 17:25:17 +01:00
impl permissions::Server for Permissions {
2022-06-24 13:57:47 +02:00
}