canonical / lxd-ui

Easy and accessible container and virtual machine management. A browser interface for LXD
GNU General Public License v3.0
281 stars 33 forks source link

Editing network fails "Network update failed Failed to check OpenFGA relation: No such entity" #875

Closed JSmith-Aura closed 2 months ago

JSmith-Aura commented 2 months ago

Version

LXD Version: 6.1 UI: 0.12

Issue

I am unable to edit a network from a project as the network is not owned by that project despite being visible under the network tab and usable with instances.

Reproduction

Create a group users that have permissions on the vms project. Defined a network in the default project, then add permissions to allow users to see the networks as follows:

/1.0/networks/my_network?project=default         
      can_edit ==> (users)  
      can_view ==> (users)
      can_delete

This will show the network owned by the default group in the Networks tab of the vms project.

When a user attempts to edit my_network from the UI this error is triggered:

Network update failed
Failed to check OpenFGA relation: No such entity "/1.0/networks/my_network?project=vms"

Looking at the API requests this is because it is trying to set the project to vms on the network object despite it belonging to the default project.

Request URL: https://example.com/1.0/networks/my_network?project=vms
Request Method: PUT
Status Code:  404 Not Found

Expected Behaviour

Being able to edit the network forwards the users have edit and view permissions on the object.

Resolution

Is it possible to fetch the project from the network itself to resolve this problem? As I would like to have a central place to edit network configurations and expose those to other projects (which seemed to be the case as I can see the networks in the other projects).

If this is just an incorrect way of configuring things, please let me know.

Thanks!

JSmith-Aura commented 2 months ago

Turns out this was just me being dense. Thanks for the great UI!