feat: support permissioned multi-repository ticket targets
This commit is contained in:
@@ -140,6 +140,12 @@ impl WorkdirSessionCapabilities {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn intersection(self, other: Self) -> Self {
|
||||
Self {
|
||||
bits: self.bits & other.bits,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn supports(self, capability: WorkdirSessionCapability) -> bool {
|
||||
let bit = match capability {
|
||||
WorkdirSessionCapability::Read => Self::READ,
|
||||
|
||||
@@ -84,6 +84,16 @@ impl WorkdirToolBroker {
|
||||
/// Own the parent Worker's active session and mediate every scoped child operation.
|
||||
pub fn new(source: WorkdirSessionHandle) -> Self {
|
||||
let capabilities = source.capabilities();
|
||||
Self::with_capabilities(source, capabilities)
|
||||
}
|
||||
|
||||
/// Own a session behind an additional Backend-authored capability ceiling.
|
||||
/// The ceiling can only attenuate provider capabilities; it can never add one.
|
||||
pub fn with_capabilities(
|
||||
source: WorkdirSessionHandle,
|
||||
capabilities: WorkdirSessionCapabilities,
|
||||
) -> Self {
|
||||
let capabilities = source.capabilities().intersection(capabilities);
|
||||
let (command_events, _) = broadcast::channel(64);
|
||||
let authority = Arc::new(ScopedWorkdirSession {
|
||||
source,
|
||||
|
||||
Reference in New Issue
Block a user