Skip to content

Commit

Permalink
lxd: Fix entitlement for group list request.
Browse files Browse the repository at this point in the history
`can_view_groups` is defined on server. For fine-grained
permissions on this endpoint, we want `can_view` defined on
`group`.

Signed-off-by: Mark Laing <mark.laing@canonical.com>
  • Loading branch information
markylaing committed Mar 4, 2024
1 parent fd7d44e commit d873bf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lxd/auth_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func getAuthGroups(d *Daemon, r *http.Request) response.Response {
recursion := request.QueryParam(r, "recursion")
s := d.State()

hasPermission, err := s.Authorizer.GetPermissionChecker(r.Context(), r, auth.EntitlementCanViewGroups, entity.TypeAuthGroup)
hasPermission, err := s.Authorizer.GetPermissionChecker(r.Context(), r, auth.EntitlementCanView, entity.TypeAuthGroup)
if err != nil {
return response.SmartError(fmt.Errorf("Failed to get a permission checker: %w", err))
}
Expand Down

0 comments on commit d873bf6

Please sign in to comment.