Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent viewer role users from getting 404 when accesing applications #4846

Conversation

cstns
Copy link
Contributor

@cstns cstns commented Nov 29, 2024

Description

  • removed the 403 triggering api calls from the application page/mixin (alongside the devices api call) and stopped passing the devices & deviceGroups as props to the router in order to leave the components that actually need that data to get it themselves
  • hid and added 'route guards' to the device groups, application pipelines, and audit log tabs
  • altered the navigation routes to use named routes instead of hardcoded ones
  • prevented the audit log, device groups and pipelines pages from calling api endpoints when the user accessing them doesn't have sufficient premissions
  • had to load deviceGroups and devices on the pipelines page after removing them from their parent

Related Issue(s)

closes #4821
closes #4687

Checklist

  • 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

…sing applications

- removed the 403 triggering api calls from the application page/mixin (alongside the devices api call) and stopped passing the devices & deviceGroups as props to the router in order to leave the components that actually need that data to get it themselves
- hid and added 'route guards' to the device groups, application pipelines, and audit log tabs
- altered the navigation routes to use named routes instead of hardcoded ones
- prevented the audit log, device groups and pipelines pages from calling api endpoints when the user accessing them doesn't have sufficient premissions
- had to load deviceGroups and devices on the pipelines page after removing them from their parant
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.67%. Comparing base (511acde) to head (66ee868).
Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4846   +/-   ##
=======================================
  Coverage   78.67%   78.67%           
=======================================
  Files         314      314           
  Lines       15125    15125           
  Branches     3483     3483           
=======================================
  Hits        11900    11900           
  Misses       3225     3225           
Flag Coverage Δ
backend 78.67% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@knolleary knolleary merged commit 499b7fd into main Dec 2, 2024
13 checks passed
@knolleary knolleary deleted the prevent-viewer-role-users-from-getting-a-404-when-accessing-applications branch December 2, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants