Skip to content

Commit

Permalink
Add permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Aug 29, 2018
1 parent 2763d97 commit ec823c2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,6 +75,8 @@ public List<Container> 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) {
Expand Down

0 comments on commit ec823c2

Please sign in to comment.