FlowFuse / flowfuse

Build bespoke, flexible, and resilient manufacturing low-code applications with FlowFuse and Node-RED
https://flowfuse.com
Other
243 stars 59 forks source link

Add permission checks on app edit and instance add #4060

Closed knolleary closed 1 week ago

knolleary commented 1 week ago

Fixes #3949

Description

Adds appropriate needsPermission checks on the following pieces of UI to hide them from users who don't have permission to do these actions:

A couple other cases were identified in 3949 - in particular around Device Groups. However, Device Groups are an EE only feature - and the way our front-end permission checks currently work means we cannot use the existing needsPermission mixin as-is. I'll raise a separate issue with details, but no need to block making these quick improvements.

Related Issue(s)

Checklist

Labels

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 78.72%. Comparing base (94e85f9) to head (d80a5ca).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4060 +/- ## ======================================= Coverage 78.72% 78.72% ======================================= Files 284 284 Lines 13008 13008 Branches 2897 2897 ======================================= Hits 10240 10240 Misses 2768 2768 ``` | [Flag](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4060/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4060/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | `78.72% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse#carryforward-flags-in-the-pull-request-comment) to find out more.

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

knolleary commented 1 week ago

There are quite a few places where direct navigation gets you to a view you can't use. I'm not going to pull on that thread here - we know the user can't do anything once on that view.