pub struct AdminConfig {
pub default_role: String,
pub admin_roles: Option<Vec<String>>,
pub admin_user_ids: Option<Vec<String>>,
pub roles: Option<HashMap<String, RolePermissions>>,
pub default_ban_reason: Option<String>,
pub default_ban_expires_in: Option<f64>,
pub impersonation_session_duration: Option<f64>,
pub banned_user_message: String,
pub banned_user_message_callback: Option<AdminBannedUserMessageHandler>,
pub allow_impersonating_admins: bool,
}Expand description
Configuration for the admin plugin.
Fields§
§default_role: StringDefault role assigned to new users and role-less permission checks.
admin_roles: Option<Vec<String>>Roles treated as “admin” for target-admin checks such as impersonation. None uses the default admin role; explicit lists are validated at initialization.
admin_user_ids: Option<Vec<String>>Users that always bypass admin permission checks.
roles: Option<HashMap<String, RolePermissions>>Custom role definitions. When provided, these replace the built-in
admin and user role permissions. None uses builtins; Some(empty) grants none.
Start from default_roles and extend admin_role to retain built-in grants.
default_ban_reason: Option<String>Default reason applied when banning a user without an explicit reason.
default_ban_expires_in: Option<f64>Default ban duration in seconds, including fractions; zero/NaN act as unset.
impersonation_session_duration: Option<f64>Custom impersonation lifetime in seconds, including fractions; zero/NaN use one hour.
banned_user_message: StringMessage surfaced to banned users.
banned_user_message_callback: Option<AdminBannedUserMessageHandler>Optional asynchronous message callback over the stored application user.
When configured, this takes precedence over banned_user_message.
allow_impersonating_admins: boolWhether other admin users may be impersonated.
Trait Implementations§
Source§impl Clone for AdminConfig
impl Clone for AdminConfig
Source§impl Debug for AdminConfig
impl Debug for AdminConfig
Auto Trait Implementations§
impl !RefUnwindSafe for AdminConfig
impl !UnwindSafe for AdminConfig
impl Freeze for AdminConfig
impl Send for AdminConfig
impl Sync for AdminConfig
impl Unpin for AdminConfig
impl UnsafeUnpin for AdminConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more