Skip to content

Commit 4931593

Browse files
committed
Add permissions tab to group edit screen (fixes stalwartlabs/mail-server#826)
1 parent c740949 commit 4931593

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/core/mod.rs

+21
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,27 @@ pub enum Permission {
212212
SieveRenameScript,
213213
SieveCheckScript,
214214
SieveHaveSpace,
215+
216+
// API keys
217+
ApiKeyList,
218+
ApiKeyGet,
219+
ApiKeyCreate,
220+
ApiKeyUpdate,
221+
ApiKeyDelete,
222+
223+
// OAuth clients
224+
OauthClientList,
225+
OauthClientGet,
226+
OauthClientCreate,
227+
OauthClientUpdate,
228+
OauthClientDelete,
229+
230+
// OAuth client registration
231+
OauthClientRegistration,
232+
OauthClientOverride,
233+
234+
#[serde(other)]
235+
Unknown,
215236
}
216237

217238
impl AccessToken {

src/pages/directory/edit.rs

+10
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ pub fn PrincipalEdit() -> impl IntoView {
163163
"user".to_string(),
164164
]);
165165
}
166+
PrincipalType::Group => {
167+
principal.enabled_permissions = PrincipalValue::StringList(vec![
168+
"email-send".to_string(),
169+
"email-receive".to_string(),
170+
]);
171+
}
166172
_ => {}
167173
}
168174

@@ -377,6 +383,7 @@ pub fn PrincipalEdit() -> impl IntoView {
377383
matches!(
378384
typ,
379385
PrincipalType::Individual
386+
| PrincipalType::Group
380387
| PrincipalType::Role
381388
| PrincipalType::Tenant
382389
)
@@ -752,6 +759,7 @@ pub fn PrincipalEdit() -> impl IntoView {
752759
!matches!(
753760
selected_type.get(),
754761
PrincipalType::Individual
762+
| PrincipalType::Group
755763
| PrincipalType::Tenant
756764
| PrincipalType::Role
757765
)
@@ -778,6 +786,7 @@ pub fn PrincipalEdit() -> impl IntoView {
778786
!matches!(
779787
selected_type.get(),
780788
PrincipalType::Individual
789+
| PrincipalType::Group
781790
| PrincipalType::Role
782791
| PrincipalType::Tenant
783792
)
@@ -796,6 +805,7 @@ pub fn PrincipalEdit() -> impl IntoView {
796805
!matches!(
797806
selected_type.get(),
798807
PrincipalType::Individual
808+
| PrincipalType::Group
799809
| PrincipalType::Role
800810
| PrincipalType::Tenant
801811
)

0 commit comments

Comments
 (0)