flowfuse icon indicating copy to clipboard operation
flowfuse copied to clipboard

Hide pipeline actionable items and guard routes based on user's permissions

Open cstns opened this issue 8 months ago • 2 comments

Description

Added route guards to the create and edit pipeline pages based on permissions and also hid the create pipeline button. Hid the create edit, delete, run stage buttons based on user permissions. Hid the create stage button from the pipeline rows

https://github.com/user-attachments/assets/d79f6dd4-1b43-4de5-a066-00e0e3b2c2cf

Related Issue(s)

closes https://github.com/FlowFuse/flowfuse/issues/4695

Checklist

  • [x] I have read the contribution guidelines
  • [ ] Suitable unit/system level tests have been added and they pass
  • [ ] Documentation has been updated
    • [ ] Upgrade instructions
    • [ ] Configuration details
    • [ ] Concepts
  • [ ] Changes flowforge.yml?
    • [ ] Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • [ ] Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • [ ] Includes a DB migration? -> add the area:migration label

cstns avatar Apr 25 '25 11:04 cstns

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.31%. Comparing base (8156389) to head (c234137). Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5465   +/-   ##
=======================================
  Coverage   77.31%   77.31%           
=======================================
  Files         350      350           
  Lines       16583    16583           
  Branches     3865     3865           
=======================================
  Hits        12821    12821           
  Misses       3762     3762           
Flag Coverage Δ
backend 77.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 25 '25 11:04 codecov[bot]

I have no idea why tests passed the 2nd time running them in CI while locally the ee/overview.spec.js test fails running headless and passes while running in browser..

marking as draft until i figure it out

cstns avatar Apr 25 '25 13:04 cstns

Hi @cstns - I have discovered by playing and reading code what the intention is (i think).

When there are multiple changes, could I ask that you be kind enough to add step-by-step or better still, Acceptance Criteria to this kinda PR (or its issue) - to help surface expectation for the reviewer please?

Something as simple as:

As Owner

  • [ ] Can view pipelines
  • [ ] Can operate play buttons
  • [ ] Can modify pipelines

As Member

  • [ ] Can view pipelines
  • [ ] Can not see play buttons
  • [ ] Can not modify pipelines
  • [ ] Can not access application pipeline edit by manually entering a URL e.g. https://5465.flowfuse.dev/team/plant-enterprise/applications/6b3WkABK8p/pipelines/zXBjYmjOv3/stages/zXBRYmROv3/edit
    • [ ] Should redirect to pipeline view https://<host>/team/<team>/applications/<app>/pipelines

As Viewer

  • [ ] Can not view tab for pipelines in application
  • [ ] Does not show pipelines in side bar
  • [ ] Can not view team pipeline by manually entering a pipeline URL e.g. https://5465.flowfuse.dev/team/plant-enterprise/pipelines
    • [ ] Should redirect to team home e.g. https://<host>/team/<team>/applications
  • [ ] Can not view application pipeline by manually entering a pipeline URL e.g. https://5465.flowfuse.dev/team/plant-enterprise/applications/6b3WkABK8p/pipelines
    • [ ] Should redirect to team home e.g. https://<host>/team/<team>/applications
  • [ ] Can not access application pipeline edit by manually entering a URL e.g. https://5465.flowfuse.dev/team/plant-enterprise/applications/6b3WkABK8p/pipelines/zXBjYmjOv3/stages/zXBRYmROv3/edit
    • [ ] Should redirect to application instances https://<host>/team/<team>/applications/<app>/instances

Steve-Mcl avatar Apr 29 '25 12:04 Steve-Mcl