Route OPNsense library and custom jobs through the standard order composer
This commit is contained in:
@@ -493,6 +493,10 @@ impl Action {
|
||||
privileged_script_profile:Some(PrivilegedScriptProfile::FullMaintenanceV1), ..}
|
||||
if interpreter=="posix_sh") && self.validate()
|
||||
}
|
||||
pub fn opnsense_service_script(&self) -> bool {
|
||||
matches!(self, Self::RunScript {interpreter,windows_execution_profile:None,privileged_script_profile:None,..}
|
||||
if interpreter=="posix_sh") && self.validate()
|
||||
}
|
||||
|
||||
/// Shared plan/revalidation/start gate. Passive inventory never implies job support.
|
||||
pub fn available_for(&self, identity: &str, capabilities: &[String]) -> bool {
|
||||
@@ -506,7 +510,8 @@ impl Action {
|
||||
let has = |cap: &str| capabilities.iter().any(|c| c == cap);
|
||||
if has("opnsense.base/1") {
|
||||
return has("run_script") && has("rmm.sync.v1") && !has("windows.base/1") && !has("linux.base/1")
|
||||
&& ((identity=="agent_service" && has("opnsense.uname/1") && self.opnsense_kernel_probe())
|
||||
&& ((identity=="agent_service" && ((has("opnsense.uname/1") && self.opnsense_kernel_probe())
|
||||
|| (has("opnsense.posix/1") && self.opnsense_service_script())))
|
||||
|| (identity=="root" && has("opnsense.root.posix/1") && has(FULL_MAINTENANCE_CAPABILITY)
|
||||
&& has("helper.root.v1") && has("root:run_script") && self.opnsense_root_script()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user