FlowFuse / flowfuse

Connect, collect, transform, visualise, and interact with your Industrial Data in a single platform. Use FlowFuse to manage, scale and secure your Node-RED solutions.
https://flowfuse.com
Other
283 stars 64 forks source link

Restricting Blueprint access based on User Tiers #3599

Closed MarianRaphael closed 7 months ago

MarianRaphael commented 8 months ago

Epic

https://github.com/FlowFuse/flowfuse/issues/2828

Description

As a: FlowFuse Admin I want to: Restrict specific Blueprints to specific Tiers So that: Only users belonging to higher Tiers, such as Teams and Enterprise, can access selected Blueprints

Which customers would this be availble to

Team + Enterprise Tiers (EE)

Acceptance Criteria

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Steve-Mcl commented 8 months ago

Config option in the Admin panel for the Flow blueprints

knolleary commented 7 months ago

Team Tiers don't have a concept of order, so we don't have a short-hand way of saying 'Team or higher' for example. So a checkbox list is probably the way to go. To avoid cluttering the already cluttered dialog, I'd suggest a select box with options 'available to all teams' and 'available to selected teams' - and only show the list of checkboxes if the second option is selected.

I would also default to 'available to all'

Steve-Mcl commented 7 months ago

Weighing up the work for adding a check list vs introducing a kind of "ordering" on the team tiers I see the following work loads: adding tier ordering is a much smaller task.

check list:

team tier ordering

Do we want to consider that route first?

knolleary commented 7 months ago

There may be bigger consequences to introducing ordering of the team tiers. I would recommend not going that route today.

For the checklist approach, this doesn't require any new apis, it'll just be a property of the blueprint that lists the team tiers it is available to. The main part is designing how that information is stored so that it can be queried easily.

The existing list blueprints api does not know anything about the context of the team making the query. So the endpoint will still end up returning all active blueprints. I'd suggest adding an optional filter parameter to the end point to return just those blueprints available to a given team tier.

The 'Create Instance' apis will need to also validate the blueprint is available to the team.

Steve-Mcl commented 7 months ago

it'll just be a property of the blueprint that lists the team tiers it is available to

As in a JSON field (array) that lists allowed teams (defaulting to "allowed" if not explicitly present)?

That certainly would scope this down compared to a many-to-many table relationship between teamtypes and flowtemplates.

@knolleary ^

knolleary commented 7 months ago

@Steve-Mcl that would be my starting point unless there was a compelling reason to do it via through-tables. We can always move to a more db structured approach in the future if necessary.

hardillb commented 7 months ago

Verified on stagine