Skip to main content

would_orphan_protected

Function would_orphan_protected 

Source
pub async fn would_orphan_protected(
    db: &Db,
    user_id: i64,
    new_role: Role,
    new_active: bool,
) -> Result<Option<Role>>
Expand description

Walk every entry in super::role::protected_roles and return the first protected role whose membership would be orphaned by the proposed change. None means the change is safe.