You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by oe...@apache.org on 2026/07/01 14:38:44 UTC

(streampipes) branch improve-rest-authorizations-for-different-ressources created (now 437caf6f67)

This is an automated email from the ASF dual-hosted git repository.

SvenO3 pushed a change to branch improve-rest-authorizations-for-different-ressources
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at 437caf6f67 Add authorization for pipeline templates

This branch includes the following new commits:

     new 367ea94019 Fix functions display
     new 437caf6f67 Add authorization for pipeline templates

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(streampipes) 02/02: Add authorization for pipeline templates

Posted by oe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

SvenO3 pushed a commit to branch improve-rest-authorizations-for-different-ressources
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 437caf6f67d60a18c28fc80292e7972db9da7aab
Author: Sven Oehler <oe...@web.de>
AuthorDate: Wed Jul 1 16:38:16 2026 +0200

    Add authorization for pipeline templates
---
 .../streampipes/rest/impl/PipelineTemplate.java    | 13 +++++++++++
 .../impl/pe/PipelineElementTemplateResource.java   | 26 +++++++++++++++++++++-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
index d35ec77377..28408cf9a8 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.api.extensions.ExtensionServiceRequestManager;
 import org.apache.streampipes.manager.template.compact.CompactPipelineTemplateManagement;
+import org.apache.streampipes.model.client.user.DefaultPrivilege;
 import org.apache.streampipes.model.template.CompactPipelineTemplate;
 import org.apache.streampipes.model.template.PipelineTemplateGenerationRequest;
 import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
@@ -30,6 +31,7 @@ import org.apache.streampipes.storage.management.StorageDispatcher;
 
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -61,6 +63,7 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
 
   @GetMapping(
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public List<CompactPipelineTemplate> findAll() {
     return storage.findAll()
         .stream()
@@ -71,6 +74,7 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
   @GetMapping(
       path = "/{id}",
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<?> findById(@PathVariable("id") String id) {
     return ok(storage.getElementById(id));
   }
@@ -79,6 +83,7 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
   @PostMapping(
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML},
       consumes = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public void create(@RequestBody CompactPipelineTemplate entity) {
     storage.persist(entity);
   }
@@ -86,11 +91,13 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
   @PutMapping(path = "/{id}",
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML},
       consumes = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public void update(@PathVariable("id") String id, @RequestBody CompactPipelineTemplate entity) {
     storage.updateElement(entity);
   }
 
   @DeleteMapping(path = "/{id}")
+  @PreAuthorize("this.hasWriteAuthority()")
   public void delete(@PathVariable("id") String id) {
     storage.deleteElementById(id);
   }
@@ -99,6 +106,7 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
   @PostMapping(path = "/{id}/pipeline",
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML},
       consumes = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<?> makePipelineFromTemplate(@RequestBody PipelineTemplateGenerationRequest request) {
     try {
       return ok(templateManagement.makePipeline(request).pipeline());
@@ -112,6 +120,7 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
   @GetMapping(
       path = "/{id}/streams",
       produces = {MediaType.APPLICATION_JSON_VALUE, SpMediaType.YAML, SpMediaType.YML})
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<Map<String, List<List<String>>>> getAvailableStreamsForTemplate(
       @PathVariable("id") String pipelineTemplateId) {
     try {
@@ -122,4 +131,8 @@ public class PipelineTemplate extends AbstractAuthGuardedRestResource {
       throw new RuntimeException(e);
     }
   }
+
+  public boolean hasWriteAuthority() {
+    return isAdminOrHasAnyAuthority(DefaultPrivilege.Constants.PRIVILEGE_WRITE_PIPELINE_VALUE);
+  }
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/PipelineElementTemplateResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/PipelineElementTemplateResource.java
index de59ef28a5..7fce6cc8b0 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/PipelineElementTemplateResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/pe/PipelineElementTemplateResource.java
@@ -21,10 +21,12 @@ package org.apache.streampipes.rest.impl.pe;
 import org.apache.streampipes.manager.template.AdapterTemplateHandler;
 import org.apache.streampipes.manager.template.DataProcessorTemplateHandler;
 import org.apache.streampipes.manager.template.DataSinkTemplateHandler;
+import org.apache.streampipes.model.client.user.DefaultPrivilege;
 import org.apache.streampipes.model.connect.adapter.AdapterDescription;
 import org.apache.streampipes.model.graph.DataProcessorInvocation;
 import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.template.PipelineElementTemplate;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import io.swagger.v3.oas.annotations.Operation;
@@ -36,6 +38,7 @@ import io.swagger.v3.oas.annotations.parameters.RequestBody;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -49,7 +52,7 @@ import java.util.List;
 
 @RestController
 @RequestMapping("/api/v2/pipeline-element-templates")
-public class PipelineElementTemplateResource extends AbstractRestResource {
+public class PipelineElementTemplateResource extends AbstractAuthGuardedRestResource {
 
   @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
   @Operation(summary = "Get a list of all pipeline element templates",
@@ -61,6 +64,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                          array = @ArraySchema(schema = @Schema(implementation = PipelineElementTemplate.class)))
                  })
              })
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<List<PipelineElementTemplate>> getAll(
       @Parameter(description = "Filter all templates by this appId")
       @RequestParam("appId") String appId
@@ -83,6 +87,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                  }),
                  @ApiResponse(responseCode = "400", description = "Template with given id not found")
              })
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<?> getById(
       @Parameter(description = "The id of the pipeline element template", required = true)
       @PathVariable("id") String s
@@ -100,6 +105,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
              responses = {
                  @ApiResponse(responseCode = "200", description = "Template successfully stored")
              })
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<Void> create(
       @RequestBody(description = "The pipeline element template to be stored",
                    content = @Content(schema = @Schema(implementation = PipelineElementTemplate.class)))
@@ -120,6 +126,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                  }, responseCode = "200", description = "Template successfully updated"),
                  @ApiResponse(responseCode = "400", description = "Template with given id not found")
              })
+  @PreAuthorize("this.hasWriteAuthority()")
   public ResponseEntity<?> update(
       @Parameter(description = "The id of the pipeline element template", required = true)
       @PathVariable("id") String id,
@@ -165,6 +172,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                          schema = @Schema(implementation = DataSinkInvocation.class))
                  }, responseCode = "200", description = "The configured data sink invocation model"),
              })
+  @PreAuthorize("this.hasWriteAuthorityPipeline()")
   public ResponseEntity<DataSinkInvocation> getPipelineElementForTemplate(
       @Parameter(description = "The id of the pipeline element template", required = true)
       @PathVariable("id") String id,
@@ -196,6 +204,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                          schema = @Schema(implementation = DataProcessorInvocation.class))
                  }, responseCode = "200", description = "The configured data processor invocation model"),
              })
+  @PreAuthorize("this.hasWriteAuthorityPipeline()")
   public ResponseEntity<DataProcessorInvocation> getPipelineElementForTemplate(
       @Parameter(description = "The id of the pipeline element template", required = true)
       @PathVariable("id") String id,
@@ -227,6 +236,7 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
                          schema = @Schema(implementation = AdapterDescription.class))
                  }, responseCode = "200", description = "The configured adapter model"),
              })
+  @PreAuthorize("this.hasWriteAuthorityAdapter()")
   public ResponseEntity<AdapterDescription> getPipelineElementForTemplate(
       @Parameter(description = "The id of the pipeline element template", required = true)
       @PathVariable("id") String id,
@@ -246,4 +256,18 @@ public class PipelineElementTemplateResource extends AbstractRestResource {
             .applyTemplateOnPipelineElement();
     return ok(desc);
   }
+
+  public boolean hasWriteAuthority() {
+    return isAdminOrHasAnyAuthority(
+        DefaultPrivilege.Constants.PRIVILEGE_WRITE_PIPELINE_VALUE,
+        DefaultPrivilege.Constants.PRIVILEGE_WRITE_ADAPTER_VALUE);
+  }
+
+  public boolean hasWriteAuthorityPipeline() {
+    return isAdminOrHasAnyAuthority(DefaultPrivilege.Constants.PRIVILEGE_WRITE_PIPELINE_VALUE);
+  }
+
+  public boolean hasWriteAuthorityAdapter() {
+    return isAdminOrHasAnyAuthority(DefaultPrivilege.Constants.PRIVILEGE_WRITE_ADAPTER_VALUE);
+  }
 }


(streampipes) 01/02: Fix functions display

Posted by oe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

SvenO3 pushed a commit to branch improve-rest-authorizations-for-different-ressources
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 367ea94019e9531bac88d3e4918911b5a4afaa67
Author: Sven Oehler <oe...@web.de>
AuthorDate: Wed Jul 1 14:40:23 2026 +0200

    Fix functions display
---
 .../streampipes/rest/impl/FunctionsResource.java   |  8 +++++++
 .../functions-logs/functions-logs.component.html   |  4 ++--
 .../functions-logs/functions-logs.component.ts     |  2 ++
 .../functions-metrics.component.html               | 22 ++++++++---------
 .../functions-metrics.component.ts                 |  2 ++
 ui/src/app/pipelines/pipelines.component.html      | 28 +++++++++++++---------
 ui/src/app/pipelines/pipelines.component.ts        | 10 ++++----
 7 files changed, 47 insertions(+), 29 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/FunctionsResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/FunctionsResource.java
index a2dcc7d8aa..7d4df9b8ea 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/FunctionsResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/FunctionsResource.java
@@ -27,12 +27,14 @@ import org.apache.streampipes.model.message.SuccessMessage;
 import org.apache.streampipes.model.monitoring.SpLogEntry;
 import org.apache.streampipes.model.monitoring.SpMetricsEntry;
 import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
+import org.apache.streampipes.rest.security.AuthConstants;
 import org.apache.streampipes.rest.shared.exception.SpMessageException;
 import org.apache.streampipes.storage.api.function.IFunctionStateStorage;
 
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -57,11 +59,13 @@ public class FunctionsResource extends AbstractAuthGuardedRestResource {
   }
 
   @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<Collection<FunctionDefinition>> getActiveFunctions() {
     return ok(FunctionRegistrationService.INSTANCE.getAllFunctions());
   }
 
   @GetMapping(path = "{functionId}", produces = MediaType.APPLICATION_JSON_VALUE)
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<FunctionDefinition> getFunction(@PathVariable("functionId") String functionId) {
     return ok(FunctionRegistrationService.INSTANCE.getFunction(functionId));
   }
@@ -70,23 +74,27 @@ public class FunctionsResource extends AbstractAuthGuardedRestResource {
       produces = MediaType.APPLICATION_JSON_VALUE,
       consumes = MediaType.APPLICATION_JSON_VALUE
   )
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<SuccessMessage> registerFunctions(@RequestBody List<FunctionDefinition> functions) {
     functions.forEach(FunctionRegistrationService.INSTANCE::registerFunction);
     return ok(Notifications.success("Function successfully registered"));
   }
 
   @DeleteMapping(path = "{functionId}", produces = MediaType.APPLICATION_JSON_VALUE)
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<SuccessMessage> deregisterFunction(@PathVariable("functionId") String functionId) {
     FunctionRegistrationService.INSTANCE.deregisterFunction(functionId);
     return ok(Notifications.success("Function successfully deregistered"));
   }
 
   @GetMapping(path = "{functionId}/metrics", produces = MediaType.APPLICATION_JSON_VALUE)
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<SpMetricsEntry> getFunctionMetrics(@PathVariable("functionId") String functionId) {
     return ok(ExtensionsLogProvider.INSTANCE.getMetricInfosForResource(functionId));
   }
 
   @GetMapping(path = "{functionId}/logs")
+  @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
   public ResponseEntity<List<SpLogEntry>> getFunctionLogs(@PathVariable("functionId") String functionId) {
     return ok(ExtensionsLogProvider.INSTANCE.getLogInfosForResource(functionId));
   }
diff --git a/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.html b/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.html
index 582cc3548e..ef06f6a17e 100644
--- a/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.html
+++ b/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.html
@@ -22,12 +22,12 @@
     [showBackLink]="true"
     [backLinkTarget]="['pipelines']"
 >
-    <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
+    <div nav fxLayout="row" fxLayoutAlign="end center">
         <button
             mat-icon-button
             color="accent"
             class="mr-10"
-            matTooltip="Refresh"
+            [matTooltip]="'Refresh' | translate"
             (click)="triggerUpdate()"
         >
             <i class="material-icons">refresh</i>
diff --git a/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.ts b/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.ts
index b0ebd1ab0f..5bb37d61eb 100644
--- a/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.ts
+++ b/ui/src/app/pipelines/components/functions-overview/functions-logs/functions-logs.component.ts
@@ -28,6 +28,7 @@ import {
 import { MatIconButton } from '@angular/material/button';
 import { MatTooltip } from '@angular/material/tooltip';
 import { SpSimpleLogsComponent } from '../../../../core-ui/monitoring/simple-logs/simple-logs.component';
+import { TranslatePipe } from '@ngx-translate/core';
 
 @Component({
     selector: 'sp-functions-logs',
@@ -41,6 +42,7 @@ import { SpSimpleLogsComponent } from '../../../../core-ui/monitoring/simple-log
         MatIconButton,
         MatTooltip,
         SpSimpleLogsComponent,
+        TranslatePipe,
     ],
 })
 export class SpFunctionsLogsComponent
diff --git a/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.html b/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.html
index fceb4f3f14..b8754c96d7 100644
--- a/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.html
+++ b/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.html
@@ -22,12 +22,12 @@
     [showBackLink]="true"
     [backLinkTarget]="['pipelines']"
 >
-    <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
+    <div nav fxLayout="row" fxLayoutAlign="end center">
         <button
             mat-icon-button
             color="accent"
             class="mr-10"
-            matTooltip="Refresh"
+            [matTooltip]="'Refresh' | translate"
             (click)="triggerUpdate()"
         >
             <i class="material-icons">refresh</i>
@@ -39,16 +39,14 @@
                 messagesIn of metrics.messagesIn | keyvalue;
                 track messagesIn
             ) {
-                <div>
-                    <sp-simple-metrics
-                        [elementName]="streamNames[messagesIn.key]"
-                        lastPublishedLabel="Last consumed message"
-                        statusValueLabel="Consumed messages"
-                        [lastTimestamp]="messagesIn.value.lastTimestamp"
-                        [statusValue]="messagesIn.value.counter"
-                    >
-                    </sp-simple-metrics>
-                </div>
+                <sp-simple-metrics
+                    [elementName]="streamNames[messagesIn.key]"
+                    [lastPublishedLabel]="'Last consumed message' | translate"
+                    [statusValueLabel]="'Consumed messages' | translate"
+                    [lastTimestamp]="messagesIn.value.lastTimestamp"
+                    [statusValue]="messagesIn.value.counter"
+                >
+                </sp-simple-metrics>
             }
         </div>
     }
diff --git a/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.ts b/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.ts
index ca691fd644..3e6d19fa4f 100644
--- a/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.ts
+++ b/ui/src/app/pipelines/components/functions-overview/functions-metrics/functions-metrics.component.ts
@@ -29,6 +29,7 @@ import { MatIconButton } from '@angular/material/button';
 import { MatTooltip } from '@angular/material/tooltip';
 import { KeyValuePipe } from '@angular/common';
 import { SpSimpleMetricsComponent } from '../../../../core-ui/monitoring/simple-metrics/simple-metrics.component';
+import { TranslatePipe } from '@ngx-translate/core';
 
 @Component({
     selector: 'sp-functions-metrics',
@@ -43,6 +44,7 @@ import { SpSimpleMetricsComponent } from '../../../../core-ui/monitoring/simple-
         MatTooltip,
         KeyValuePipe,
         SpSimpleMetricsComponent,
+        TranslatePipe,
     ],
 })
 export class SpFunctionsMetricsComponent
diff --git a/ui/src/app/pipelines/pipelines.component.html b/ui/src/app/pipelines/pipelines.component.html
index 4ff79306f7..34c0db5950 100644
--- a/ui/src/app/pipelines/pipelines.component.html
+++ b/ui/src/app/pipelines/pipelines.component.html
@@ -73,19 +73,25 @@
                     }
                 </div>
             </div>
-            <div fxFlex="100" fxLayout="column" style="margin-top: 20px">
-                <sp-basic-header-title-component
-                    title="Functions"
-                ></sp-basic-header-title-component>
-                <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
-                    <div fxFlex="100">
-                        @if (functionsReady) {
-                            <sp-functions-overview [functions]="functions">
-                            </sp-functions-overview>
-                        }
+            @if (isAdminRole) {
+                <div fxFlex="100" fxLayout="column" style="margin-top: 20px">
+                    <sp-basic-header-title-component
+                        title="Functions"
+                    ></sp-basic-header-title-component>
+                    <div
+                        fxFlex="100"
+                        fxLayout="row"
+                        fxLayoutAlign="center start"
+                    >
+                        <div fxFlex="100">
+                            @if (functionsReady) {
+                                <sp-functions-overview [functions]="functions">
+                                </sp-functions-overview>
+                            }
+                        </div>
                     </div>
                 </div>
-            </div>
+            }
         </div>
     </div>
 </sp-basic-view>
diff --git a/ui/src/app/pipelines/pipelines.component.ts b/ui/src/app/pipelines/pipelines.component.ts
index 5f94bcc0e6..d755a95f39 100644
--- a/ui/src/app/pipelines/pipelines.component.ts
+++ b/ui/src/app/pipelines/pipelines.component.ts
@@ -132,10 +132,12 @@ export class PipelinesComponent implements OnInit, OnDestroy {
     }
 
     getFunctions() {
-        this.functionsService.getActiveFunctions().subscribe(functions => {
-            this.functions = functions.map(f => f.functionId).sort();
-            this.functionsReady = true;
-        });
+        if (this.isAdminRole) {
+            this.functionsService.getActiveFunctions().subscribe(functions => {
+                this.functions = functions.map(f => f.functionId).sort();
+                this.functionsReady = true;
+            });
+        }
     }
 
     getPipelines() {