1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-03 22:45:01 +00:00

Administrators can change user email address

This commit is contained in:
2021-07-13 16:54:38 +02:00
parent d0f87467ec
commit 71254c47f1
5 changed files with 45 additions and 4 deletions

View File

@ -15,6 +15,7 @@ pub enum AdminAction {
AddAdminRole { target: AdminID, role: String },
RemoveAdminRole { target: AdminID, role: String },
AccessUserPage { user_id: UserID, user_name: String },
ChangedEmailAddress { user_id: UserID, user_name: String, old_mail: String, new_mail: String },
UnsupportedAction { raw_data: String },
}
@ -47,7 +48,11 @@ impl AdminAction {
AdminAction::RemoveAdminRole { .. } =>
{ "Removed a role from [admin]{target}[/admin] => {role}" }
AdminAction::AccessUserPage { .. } => { "Administrator accessed information of user #{user_id} '{user_name}'." }
AdminAction::AccessUserPage { .. } =>
{ "Accessed information of user #{user_id} '{user_name}'." }
AdminAction::ChangedEmailAddress { .. } =>
{ "Changed email address of user #{user_id} '{user_name}' from {old_mail} to {new_mail}" }
AdminAction::UnsupportedAction { .. } => { "Unsupported action. Raw data: {raw_data}" }
}

View File

@ -8,7 +8,7 @@ use crate::utils::user_data_utils::user_data_url;
///! User information
///!
///! @author Pierre Hubert
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug, Copy)]
pub struct UserID(u64);
impl UserID {