add privilege check on kill
@@ -17,6 +17,8 @@ use std::sync::Arc;
use common_datavalues::DataSchema;
use common_exception::ErrorCode;
use common_exception::Result;
+use common_meta_types::GrantObject;
+use common_meta_types::UserPrivilegeType;
use common_planners::KillPlan;
use common_streams::DataBlockStream;
use common_streams::SendableDataBlockStream;
@@ -46,6 +48,10 @@ impl Interpreter for KillInterpreter {
&self,
_input_stream: Option<SendableDataBlockStream>,
) -> Result<SendableDataBlockStream> {
+ self.ctx
+ .get_session()
+ .validate_privilege(&GrantObject::Global, UserPrivilegeType::Super)?;
+
let id = &self.plan.id;
match self.ctx.get_sessions_manager().get_session(id) {
None => Err(ErrorCode::UnknownSession(format!(
