Skip to main content

may_set_profile_field

Function may_set_profile_field 

Source
pub(crate) async fn may_set_profile_field<T>(
    services: &Services,
    body: &Ruma<T>,
    field: &ProfileFieldName,
    is_admin: impl AsyncFnOnce() -> bool,
) -> bool
where T: Sync,
Expand description

Whether the caller may change a profile field under profile.enable_set_displayname and profile.enable_set_avatar_url.

Fields without an option are always allowed. Appservices and server admins are exempt, matching Synapse’s exemption for admins. is_admin is awaited only when the field’s option is off and the caller is not an appservice.