api: namespace list: fix restrictive priv checking

This endpoint only lists all accessible namespace, and one doesn't
necessarily needs to have permissions on the parent itself just to
have OK ACLs on deeper down NS.

So, drop the upfront check on parent but explicitly avoid leaking if
a NS exists or not, i.e., only do so if they got access on the parent
NS.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht committed 2022-05-27 11:14:01 +02:00
1 parent 49d604aec1
commit 2393943fbb
2 files changed
+21 -16

No files matched your search

+1 -1
View File
@@ -142,7 +142,7 @@ impl<'a> ListAccessibleBackupGroups<'a> {
}
}
static NS_PRIVS_OK: u64 =
pub static NS_PRIVS_OK: u64 =
PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_READ | PRIV_DATASTORE_BACKUP | PRIV_DATASTORE_AUDIT;
impl<'a> Iterator for ListAccessibleBackupGroups<'a> {