pub(crate) async fn may_set_profile_field<T>(
services: &Services,
body: &Ruma<T>,
field: &ProfileFieldName,
is_admin: impl AsyncFnOnce() -> bool,
) -> boolwhere
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.