Skip to content

Commit

Permalink
Merge pull request #708 from stgraber/project
Browse files Browse the repository at this point in the history
incusd/project: Allow managed volumes under "allow"
  • Loading branch information
hallyn authored Mar 30, 2024
2 parents 18a13cd + 54bb8dd commit 0d3c5a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/server/project/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,11 @@ func checkRestrictions(project api.Project, instances []api.Instance, profiles [
}

case "allow":
var allowed bool
allowed, _ = CheckRestrictedDevicesDiskPaths(project.Config, device["source"])
if !allowed {
return fmt.Errorf("Disk source path %q not allowed", device["source"])
if device["pool"] == "" {
allowed, _ := CheckRestrictedDevicesDiskPaths(project.Config, device["source"])
if !allowed {
return fmt.Errorf("Disk source path %q not allowed", device["source"])
}
}
}

Expand Down

0 comments on commit 0d3c5a6

Please sign in to comment.