[PR #213] [MERGED] fix: 🐛 fix UpdateACL function to take correct parameters #216

Closed
opened 2026-03-03 15:30:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/luthermonson/go-proxmox/pull/213
Author: @kernel-sanders
Created: 8/27/2025
Status: Merged
Merged: 9/8/2025
Merged by: @luthermonson

Base: mainHead: main


📝 Commits (1)

  • 3f43b0b fix: 🐛 fix UpdateACL function to take correct parameters

📊 Changes

2 files changed (+14 additions, -14 deletions)

View changed files

📝 access.go (+2 -2)
📝 types.go (+12 -12)

📄 Description

The ACL struct is what the /access/acl endpoint returns to a GET request, however a PUT requires we send ACLOptions. This pull request modifies the UpdateACL function in access.go to send the ACLOptions where it previously tried to send the ACL struct which resulted in a 400 error.

GET /access/acl API docs:

image

ACL struct from types.go:

type ACL struct {
	Path      string    `json:"path,omitempty"`
	RoleID    string    `json:"roleid,omitempty"`
	Type      string    `json:"type,omitempty"`
	UGID      string    `json:"ugid,omitempty"`
	Propagate IntOrBool `json:"propagate,omitempty"`
}

PUT /access/acl API docs:

image

ACLOptions struct from types.go:

type ACLOptions struct {
	Path      string    `json:"path,omitempty"`
	Roles     string    `json:"roles,omitempty"` // comma separated list of roles
	Groups    string    `json:"groups,omitempty"`
	Users     string    `json:"users,omitempty"`
	Tokens    string    `json:"tokens,omitempty"`
	Propagate IntOrBool `json:"propagate"`        // Default is true, omitempty would never send false
	Delete    IntOrBool `json:"delete,omitempty"` // true to delete the ACL
}

fixes #180


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/luthermonson/go-proxmox/pull/213 **Author:** [@kernel-sanders](https://github.com/kernel-sanders) **Created:** 8/27/2025 **Status:** ✅ Merged **Merged:** 9/8/2025 **Merged by:** [@luthermonson](https://github.com/luthermonson) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`3f43b0b`](https://github.com/luthermonson/go-proxmox/commit/3f43b0bbe86a2d03258fd8ae609e08b0ba46571f) fix: 🐛 fix UpdateACL function to take correct parameters ### 📊 Changes **2 files changed** (+14 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `access.go` (+2 -2) 📝 `types.go` (+12 -12) </details> ### 📄 Description The `ACL` struct is what the `/access/acl` endpoint returns to a GET request, however a PUT requires we send `ACLOptions`. This pull request modifies the `UpdateACL` function in access.go to send the `ACLOptions` where it previously tried to send the `ACL` struct which resulted in a 400 error. GET `/access/acl` API docs: <img width="872" height="666" alt="image" src="https://github.com/user-attachments/assets/e44beaba-a059-4d6c-80d5-b4f87ba1f08b" /> `ACL` struct from types.go: ``` type ACL struct { Path string `json:"path,omitempty"` RoleID string `json:"roleid,omitempty"` Type string `json:"type,omitempty"` UGID string `json:"ugid,omitempty"` Propagate IntOrBool `json:"propagate,omitempty"` } ``` PUT `/access/acl` API docs: <img width="997" height="805" alt="image" src="https://github.com/user-attachments/assets/853c4bc3-70a2-4456-8c64-ff584af5d75c" /> `ACLOptions` struct from types.go: ``` type ACLOptions struct { Path string `json:"path,omitempty"` Roles string `json:"roles,omitempty"` // comma separated list of roles Groups string `json:"groups,omitempty"` Users string `json:"users,omitempty"` Tokens string `json:"tokens,omitempty"` Propagate IntOrBool `json:"propagate"` // Default is true, omitempty would never send false Delete IntOrBool `json:"delete,omitempty"` // true to delete the ACL } ``` fixes #180 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 15:30:45 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-proxmox#216
No description provided.