Skip to main content

enforce_self_demote_safe

Function enforce_self_demote_safe 

Source
pub fn enforce_self_demote_safe(
    actor: &Identity,
    target_id: i64,
    new_role: Role,
    new_active: bool,
) -> Result<()>
Expand description

Forbid a user from saving an edit to their own record that drops their role below its current rank or flips is_active to false. Self-keep-rank is allowed; raising one’s own rank is blocked separately by enforce_role_ceiling.