Skip to content

Commit 2d08f24

Browse files
authored
Merge pull request #657 from runzexia/computer-info-permission
2 parents e10afe4 + a07def3 commit 2d08f24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesComputer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void taskCompletedWithProblems(Executor executor, Queue.Task task, long d
6969

7070
@Exported
7171
public List<Container> getContainers() throws KubernetesAuthException, IOException {
72-
if(!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
72+
if(!Jenkins.get().hasPermission(Computer.EXTENDED_READ)) {
7373
LOGGER.log(Level.FINE, " Computer {0} getContainers, lack of admin permission, returning empty list", this);
7474
return Collections.emptyList();
7575
}
@@ -90,7 +90,7 @@ public List<Container> getContainers() throws KubernetesAuthException, IOExcepti
9090

9191
@Exported
9292
public List<Event> getPodEvents() throws KubernetesAuthException, IOException {
93-
if(!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
93+
if(!Jenkins.get().hasPermission(Computer.EXTENDED_READ)) {
9494
LOGGER.log(Level.FINE, " Computer {0} getPodEvents, lack of admin permission, returning empty list", this);
9595
return Collections.emptyList();
9696
}
@@ -124,7 +124,7 @@ public List<Event> getPodEvents() throws KubernetesAuthException, IOException {
124124

125125
public void doContainerLog(@QueryParameter String containerId,
126126
StaplerRequest req, StaplerResponse rsp) throws KubernetesAuthException, IOException {
127-
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
127+
Jenkins.get().checkPermission(Computer.EXTENDED_READ);
128128

129129
ByteBuffer outputStream = new ByteBuffer();
130130
KubernetesSlave slave = getNode();

0 commit comments

Comments
 (0)