twizzler_security/sec_ctx/mod.rs
1use twizzler_abi::object::{ObjID, Protections};
2
3mod base;
4pub use base::*;
5
6#[cfg(feature = "user")]
7mod user;
8
9#[cfg(feature = "user")]
10pub use user::*;
11
12/// Information about protections for a given object within a context.
13#[derive(Clone, Copy, Debug)]
14pub struct PermsInfo {
15 /// The `ObjID` of the `SecCtx` providing these permissions.
16 pub ctx: ObjID,
17 /// The `Protections` being provided.
18 pub provide: Protections,
19 /// The `Protections` being restricted.
20 pub restrict: Protections,
21}
22
23impl PermsInfo {
24 /// Create a new instance of `PermsInfo`.
25 pub fn new(ctx: ObjID, provide: Protections, restrict: Protections) -> Self {
26 Self {
27 ctx,
28 provide,
29 restrict,
30 }
31 }
32}