We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was trying to use func (c *Client) UpdateACL(ctx context.Context, acl ACL) error to add ACLs to a Pool.
func (c *Client) UpdateACL(ctx context.Context, acl ACL) error
Something like :
var acl pmx.ACL acl = pmx.ACL{ RoleID: "PVEPoolAdmin", UGID: fmt.Sprintf("%[email protected]", pool), Propagate: true, Path: fmt.Sprintf("/pool/%s", pool), Type: "user", } s, err := json.Marshal(acl) slog.Info(string(s)) err = p.client.UpdateACL(context.Background(), acl) if err != nil { slog.Error("Error updating acl", slog.String("acl", fmt.Sprintf("%+v", acl)), slog.String("error", err.Error())) }
It seems that can't be used, and is being sent as-is to /access/acl, without proper lowercase on map keys (see missing key in tags at
/access/acl
go-proxmox/types.go
Line 1266 in 5617b30
I ended up doing this, which works fine :
acl := struct { Path string `json:"path"` Roles string `json:"roles"` Users string `json:"users"` Propagate bool `json:"propagate"` }{ Path: fmt.Sprintf("/pool/%s", pool), Roles: "PVEVMAdmin,PVEPoolAdmin", Users: fmt.Sprintf("%[email protected]", pool), Propagate: true, } err = p.client.Put(context.Background(), "/access/acl", acl, nil) if err != nil { slog.Error("Error updating ACL", slog.String("acl", fmt.Sprintf("%+v", acl)), slog.String("error", err.Error())) }
Maybe I'm doing something wrong, using a wrong API version somehow ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was trying to use
func (c *Client) UpdateACL(ctx context.Context, acl ACL) error
to add ACLs to a Pool.Something like :
It seems that can't be used, and is being sent as-is to
/access/acl
, without proper lowercase on map keys (see missing key in tags atgo-proxmox/types.go
Line 1266 in 5617b30
I ended up doing this, which works fine :
Maybe I'm doing something wrong, using a wrong API version somehow ?
The text was updated successfully, but these errors were encountered: