[pbs-devel] [PATCH proxmox-backup] api: tape: add permission to move_tape endpoint
Hannes Laimer
h.laimer at proxmox.com
Wed Nov 6 11:45:12 CET 2024
... so it is usable by non-root users, this came up in support.
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
This came up in enterprise support, but it also makes sense generally
src/api2/tape/media.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/api2/tape/media.rs b/src/api2/tape/media.rs
index a7c8483a..2ed3e961 100644
--- a/src/api2/tape/media.rs
+++ b/src/api2/tape/media.rs
@@ -9,7 +9,8 @@ use proxmox_uuid::Uuid;
use pbs_api_types::{
Authid, MediaContentEntry, MediaContentListFilter, MediaListEntry, MediaPoolConfig,
MediaSetListEntry, MediaStatus, CHANGER_NAME_SCHEMA, MEDIA_LABEL_SCHEMA,
- MEDIA_POOL_NAME_SCHEMA, MEDIA_UUID_SCHEMA, PRIV_TAPE_AUDIT, VAULT_NAME_SCHEMA,
+ MEDIA_POOL_NAME_SCHEMA, MEDIA_UUID_SCHEMA, PRIV_TAPE_AUDIT, PRIV_TAPE_MODIFY,
+ VAULT_NAME_SCHEMA,
};
use pbs_config::CachedUserInfo;
@@ -305,6 +306,9 @@ pub async fn list_media(
},
},
},
+ access: {
+ permission: &Permission::Privilege(&["tape"], PRIV_TAPE_MODIFY, false),
+ },
)]
/// Change Tape location to vault (if given), or offline.
pub fn move_tape(
--
2.39.5
More information about the pbs-devel
mailing list