WebDAV permissions and logging (closes #1362)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
use ahash::AHashSet;
|
||||
use directory::{
|
||||
QueryBy, Type,
|
||||
Permission, QueryBy, Type,
|
||||
backend::{
|
||||
RcptType,
|
||||
internal::{
|
||||
@@ -774,6 +774,7 @@ pub trait TestInternalDirectory {
|
||||
async fn create_test_group(&self, login: &str, name: &str, emails: &[&str]) -> u32;
|
||||
async fn create_test_list(&self, login: &str, name: &str, emails: &[&str]) -> u32;
|
||||
async fn set_test_quota(&self, login: &str, quota: u32);
|
||||
async fn add_permissions(&self, login: &str, permissions: impl IntoIterator<Item = Permission>);
|
||||
async fn add_to_group(&self, login: &str, group: &str) -> ChangedPrincipals;
|
||||
async fn remove_from_group(&self, login: &str, group: &str) -> ChangedPrincipals;
|
||||
async fn remove_test_alias(&self, login: &str, alias: &str);
|
||||
@@ -898,6 +899,28 @@ impl TestInternalDirectory for Store {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn add_permissions(
|
||||
&self,
|
||||
login: &str,
|
||||
permissions: impl IntoIterator<Item = Permission>,
|
||||
) {
|
||||
self.update_principal(
|
||||
UpdatePrincipal::by_name(login).with_updates(
|
||||
permissions
|
||||
.into_iter()
|
||||
.map(|p| {
|
||||
PrincipalUpdate::add_item(
|
||||
PrincipalField::EnabledPermissions,
|
||||
PrincipalValue::String(p.name().to_string()),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn add_to_group(&self, login: &str, group: &str) -> ChangedPrincipals {
|
||||
self.update_principal(UpdatePrincipal::by_name(login).with_updates(vec![
|
||||
PrincipalUpdate::add_item(
|
||||
|
||||
Reference in New Issue
Block a user