[pbs-devel] [PATCH proxmox-backup v2 2/6] backup: hierarchy: reuse 'NS_PRIVS_OK' for namespace helper

Dominik Csapak d.csapak at proxmox.com
Wed Oct 8 15:43:32 CEST 2025


Aside from the order of the privileges, it's identical to what we
already used here, so simply reuse it.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
no changes in v2

 src/backup/hierarchy.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/backup/hierarchy.rs b/src/backup/hierarchy.rs
index febcb9a83..be11ece05 100644
--- a/src/backup/hierarchy.rs
+++ b/src/backup/hierarchy.rs
@@ -83,12 +83,10 @@ pub fn can_access_any_namespace_below(
     let Ok(mut iter) = store.recursive_iter_backup_ns_ok(ns, max_depth) else {
         return false;
     };
-    let wanted =
-        PRIV_DATASTORE_AUDIT | PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_READ | PRIV_DATASTORE_BACKUP;
     let name = store.name();
     iter.any(|ns| -> bool {
         let user_privs = user_info.lookup_privs(auth_id, &["datastore", name, &ns.to_string()]);
-        user_privs & wanted != 0
+        user_privs & NS_PRIVS_OK != 0
     })
 }
 
-- 
2.47.3





More information about the pbs-devel mailing list