accessible group iter: allow NS descending with DATASTORE_READ
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f7247e2b84
commit
49bea6b5d9
|
@ -4,6 +4,7 @@ use anyhow::Error;
|
||||||
|
|
||||||
use pbs_api_types::{
|
use pbs_api_types::{
|
||||||
Authid, BackupNamespace, PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_MODIFY,
|
Authid, BackupNamespace, PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_MODIFY,
|
||||||
|
PRIV_DATASTORE_READ,
|
||||||
};
|
};
|
||||||
use pbs_config::CachedUserInfo;
|
use pbs_config::CachedUserInfo;
|
||||||
use pbs_datastore::{backup_info::BackupGroup, DataStore, ListGroups, ListNamespacesRecursive};
|
use pbs_datastore::{backup_info::BackupGroup, DataStore, ListGroups, ListNamespacesRecursive};
|
||||||
|
@ -41,11 +42,13 @@ impl<'a> ListAccessibleBackupGroups<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NS_PRIVS_OK: u64 =
|
||||||
|
PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_READ | PRIV_DATASTORE_BACKUP | PRIV_DATASTORE_AUDIT;
|
||||||
|
|
||||||
impl<'a> Iterator for ListAccessibleBackupGroups<'a> {
|
impl<'a> Iterator for ListAccessibleBackupGroups<'a> {
|
||||||
type Item = Result<BackupGroup, Error>;
|
type Item = Result<BackupGroup, Error>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
const PRIVS_OK: u64 = PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_BACKUP | PRIV_DATASTORE_AUDIT;
|
|
||||||
loop {
|
loop {
|
||||||
if let Some(ref mut state) = self.state {
|
if let Some(ref mut state) = self.state {
|
||||||
match state.next() {
|
match state.next() {
|
||||||
|
|
Loading…
Reference in New Issue