Skip to content

Commit

Permalink
handle error when the user has a pending user group key rotation and …
Browse files Browse the repository at this point in the history
…cannot become an admin

#tutadb1843
  • Loading branch information
vaf-hub committed Sep 2, 2024
1 parent dca1c48 commit 42c8655
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/common/misc/TranslationKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1740,3 +1740,4 @@ export type TranslationKeyType =
| "yourMessage_label"
| "you_label"
| "emptyString_msg"
| "makeAdminPendingUserGroupKeyRotationError_msg"
13 changes: 12 additions & 1 deletion src/common/settings/UserViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,18 @@ export class UserViewer implements UpdatableSettingsDetailsViewer {
} else {
showProgressDialog(
"pleaseWait_msg",
this.user.getAsync().then((user) => locator.userManagementFacade.changeAdminFlag(user, value)),
this.user
.getAsync()
.then((user) => locator.userManagementFacade.changeAdminFlag(user, value))
.catch(
ofClass(PreconditionFailedError, (e) => {
if (e.data && e.data === "usergroup.pending-key-rotation") {
Dialog.message("makeAdminPendingUserGroupKeyRotationError_msg")
} else {
throw e
}
}),
),
)
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/mail-app/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@ export default {
"yourCalendars_label": "Deine Kalender",
"yourFolders_action": "DEINE ORDNER",
"yourMessage_label": "Deine Nachricht",
"you_label": "Du"
"you_label": "Du",
"makeAdminPendingUserGroupKeyRotationError_msg": "Der Benutzer kann zur Zeit keine Admin-Rechte erhalten. Der Benutzer muss sich von all seinen Geräten ausloggen und neu einloggen. Anschließend kann die Aktion ausgeführt werden."
}
}
3 changes: 2 additions & 1 deletion src/mail-app/translations/de_sie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@ export default {
"yourCalendars_label": "Deine Kalender",
"yourFolders_action": "Ihre ORDNER",
"yourMessage_label": "Ihre Nachricht",
"you_label": "Sie"
"you_label": "Sie",
"makeAdminPendingUserGroupKeyRotationError_msg": "Der Benutzer kann zur Zeit keine Admin-Rechte erhalten. Der Benutzer muss sich von all seinen Geräten ausloggen und neu einloggen. Anschließend kann die Aktion ausgeführt werden."
}
}
3 changes: 2 additions & 1 deletion src/mail-app/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,7 @@ export default {
"yourCalendars_label": "Your calendars",
"yourFolders_action": "YOUR FOLDERS",
"yourMessage_label": "Your message",
"you_label": "You"
"you_label": "You",
"makeAdminPendingUserGroupKeyRotationError_msg": "The user currently cannot become admin. Please ask the user to logout with all their devices and then login again. Afterwards try again."
}
}

0 comments on commit 42c8655

Please sign in to comment.