Skip to content

Commit

Permalink
Add permissions tab to group edit screen (fixes stalwartlabs/mail-ser…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Oct 1, 2024
1 parent c740949 commit 4931593
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,27 @@ pub enum Permission {
SieveRenameScript,
SieveCheckScript,
SieveHaveSpace,

// API keys
ApiKeyList,
ApiKeyGet,
ApiKeyCreate,
ApiKeyUpdate,
ApiKeyDelete,

// OAuth clients
OauthClientList,
OauthClientGet,
OauthClientCreate,
OauthClientUpdate,
OauthClientDelete,

// OAuth client registration
OauthClientRegistration,
OauthClientOverride,

#[serde(other)]
Unknown,
}

impl AccessToken {
Expand Down
10 changes: 10 additions & 0 deletions src/pages/directory/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ pub fn PrincipalEdit() -> impl IntoView {
"user".to_string(),
]);
}
PrincipalType::Group => {
principal.enabled_permissions = PrincipalValue::StringList(vec![
"email-send".to_string(),
"email-receive".to_string(),
]);
}
_ => {}
}

Expand Down Expand Up @@ -377,6 +383,7 @@ pub fn PrincipalEdit() -> impl IntoView {
matches!(
typ,
PrincipalType::Individual
| PrincipalType::Group
| PrincipalType::Role
| PrincipalType::Tenant
)
Expand Down Expand Up @@ -752,6 +759,7 @@ pub fn PrincipalEdit() -> impl IntoView {
!matches!(
selected_type.get(),
PrincipalType::Individual
| PrincipalType::Group
| PrincipalType::Tenant
| PrincipalType::Role
)
Expand All @@ -778,6 +786,7 @@ pub fn PrincipalEdit() -> impl IntoView {
!matches!(
selected_type.get(),
PrincipalType::Individual
| PrincipalType::Group
| PrincipalType::Role
| PrincipalType::Tenant
)
Expand All @@ -796,6 +805,7 @@ pub fn PrincipalEdit() -> impl IntoView {
!matches!(
selected_type.get(),
PrincipalType::Individual
| PrincipalType::Group
| PrincipalType::Role
| PrincipalType::Tenant
)
Expand Down

0 comments on commit 4931593

Please sign in to comment.