From ec823c20db51687efeb52bad660a920d0e32768c Mon Sep 17 00:00:00 2001 From: suren Date: Wed, 29 Aug 2018 10:35:05 +0800 Subject: [PATCH] Add permission check --- .../jenkins/plugins/kubernetes/KubernetesComputer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesComputer.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesComputer.java index 16974073a3..8f7a9a416c 100644 --- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesComputer.java +++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesComputer.java @@ -6,6 +6,7 @@ import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.KubernetesClient; +import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; @@ -74,6 +75,8 @@ public List getContainers() throws UnrecoverableKeyException, Certifi public void doContainerLog(@QueryParameter String containerId, StaplerRequest req, StaplerResponse rsp) throws UnrecoverableKeyException, CertificateEncodingException, NoSuchAlgorithmException, KeyStoreException, IOException { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); + ByteBuffer outputStream = new ByteBuffer(); KubernetesSlave slave = getNode(); if(slave != null) {