[PR #315] [MERGED] Feature: Dynamic permission checking. #388

Closed
opened 2026-02-28 00:42:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/315
Author: @Tinyblargon
Created: 3/5/2024
Status: Merged
Merged: 3/9/2024
Merged by: @Tinyblargon

Base: masterHead: Feature#308


📝 Commits (4)

  • 7d7642c feat: permission checking
  • a8821f0 feat: add example to update the permisson cache
  • 4b38dbf fix: returned error when permission does not exist
  • 60d15a6 fix: panic permissions nil

📊 Changes

6 files changed (+853 additions, -9 deletions)

View changed files

📝 proxmox/client.go (+107 -9)
📝 proxmox/client_test.go (+44 -0)
📝 proxmox/config_qemu.go (+3 -0)
proxmox/permission.go (+651 -0)
proxmox/permission_test.go (+39 -0)
📝 proxmox/util.go (+9 -0)

📄 Description

Add a framework for checking if the user has the right permissions to do a given operation.
The main function this adds is *Client.CheckPermissions().

This Feature is mostly adding new code and isn't modifying any existing code/behavior.
The only place some modification was made to existing code is in ConfigQemu.setAdvanced() where *Client.insertCachedPermission() is called as an example, and to satisfy the static check. This adds an item to a currently empty empty cache.

Closes #308


🔄 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/Telmate/proxmox-api-go/pull/315 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 3/5/2024 **Status:** ✅ Merged **Merged:** 3/9/2024 **Merged by:** [@Tinyblargon](https://github.com/Tinyblargon) **Base:** `master` ← **Head:** `Feature#308` --- ### 📝 Commits (4) - [`7d7642c`](https://github.com/Telmate/proxmox-api-go/commit/7d7642c88de79aad35796ba8bc6ce3de7b92c9b1) feat: permission checking - [`a8821f0`](https://github.com/Telmate/proxmox-api-go/commit/a8821f06d2400c2ab99ccad33088c80bd21622c4) feat: add example to update the permisson cache - [`4b38dbf`](https://github.com/Telmate/proxmox-api-go/commit/4b38dbf4da39d20547362602be48909b33dc607f) fix: returned error when permission does not exist - [`60d15a6`](https://github.com/Telmate/proxmox-api-go/commit/60d15a664276b33fe11d45fe00cb8cb05534295e) fix: panic permissions nil ### 📊 Changes **6 files changed** (+853 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/client.go` (+107 -9) 📝 `proxmox/client_test.go` (+44 -0) 📝 `proxmox/config_qemu.go` (+3 -0) ➕ `proxmox/permission.go` (+651 -0) ➕ `proxmox/permission_test.go` (+39 -0) 📝 `proxmox/util.go` (+9 -0) </details> ### 📄 Description Add a framework for checking if the user has the right permissions to do a given operation. The main function this adds is `*Client.CheckPermissions()`. This Feature is mostly adding new code and isn't modifying any existing code/behavior. The only place some modification was made to existing code is in `ConfigQemu.setAdvanced()` where `*Client.insertCachedPermission()` is called as an example, and to satisfy the static check. This adds an item to a currently empty empty cache. Closes #308 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:42:00 +03:00
Sign in to join this conversation.
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/proxmox-api-go#388
No description provided.