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

Alter the destination of the applications more link for viewer role users #4826

Closed

Conversation

cstns
Copy link
Contributor

@cstns cstns commented Nov 25, 2024

Description

  • viewer roles do not have access to team device-groups, which returned a 403 when viewer roles attempted to open the applications instances/devices page resulting in a 404 page
  • also wrapped the hasAMinimumTeamRoleOf to verbosely check for member roles

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

…sers

- viewer roles do not have access to team device-groups, which returned a 403 when viewer roles attempted to open the applications instances/devices page resulting in a 404 page
- also wrapped the hasAMinimumTeamRoleOf to verbosely check for member roles
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.67%. Comparing base (4ab0fb2) to head (9cc42c0).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4826   +/-   ##
=======================================
  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.

Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is how we want to address this. As it stands, a Viewer role is unable to view device-groups. But that should not mean they cannot view the application - because they need to be able to browse the list of instances/devices available to them.

The 403 in retrieving groups should be handled (even better, don't try to load device groups) - similarly for any other resources that view tries to load that the Viewer role doesn't have access to.

@cstns
Copy link
Contributor Author

cstns commented Nov 29, 2024

Going with an alternate fix implemented in #4846

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