fabaccess-bffh/bffhd/capnp/session.rs
Nadja Reitzenstein 87af5fde94 Implement more API
2022-03-12 17:31:53 +01:00

24 lines
855 B
Rust

use api::authenticationsystem_capnp::response::successful::Builder;
use capnp::capability::Promise;
use crate::authorization::AuthorizationHandle;
use crate::capnp::machinesystem::Machines;
use crate::capnp::permissionsystem::Permissions;
use crate::capnp::user_system::Users;
use crate::session::{SessionHandle, SessionManager};
use crate::users::User;
#[derive(Debug, Clone)]
pub struct APISession;
impl APISession {
pub fn new() -> Self {
Self
}
pub fn build(session: SessionHandle, mut builder: Builder) {
let mut builder = builder.init_session();
builder.set_machine_system(capnp_rpc::new_client(Machines::new(session.clone())));
builder.set_user_system(capnp_rpc::new_client(Users::new(session.clone())));
builder.set_permission_system(capnp_rpc::new_client(Permissions::new(session)));
}
}