<@U04UQ68083H> When using Ory Elements, is there a...
# ory-copilot
p
@chilly-king-10285 When using Ory Elements, is there a way to mark a profile element as not-changeable? We do not allow users to change their username, but they can change their email address and password.
b
A message from kapa.ai
Based on the available knowledge sources, there is no explicit documentation or example showing a built-in way in Ory Elements or Ory Identities to mark a specific profile element (such as the username) as not-changeable (read-only) while allowing others (like email or password) to be editable. However, the UI nodes returned by Ory for the settings/profile update flow include an attribute called
disabled
, which can be set to
true
to make an input field non-editable. The API response for settings/profile nodes includes this property, but the knowledge sources do not specify a configuration option in the identity schema or Ory Console to set this for specific fields like the username. The default behavior is that the fields presented in the settings flow are determined by your identity schema, and all are editable unless you implement custom logic in your UI to render certain fields as read-only based on your requirements. If you want to prevent users from changing their username, you would typically need to: - Exclude the username field from the editable fields in your custom UI, or - Render the username field as disabled/read-only in your UI by checking the field name and setting the
disabled
attribute accordingly. There is no mention of a built-in Ory Elements or Ory Console setting to make a specific trait non-editable out of the box. You may need to handle this in your UI layer or with custom hooks/actions if you want to enforce this at the API level as well [Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings) [Identity schema](https://www.ory.sh/docs/kratos/manage-identities/identity-schema). If you need to enforce this restriction strictly, consider implementing a pre-update hook that rejects changes to the username trait [Hooks](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#hooks). Summary: There is no direct configuration in Ory Elements or Ory Console to mark a profile element as not-changeable; you must handle this in your UI or with custom hooks.
p
@chilly-king-10285 When I do set the UI element to disabled, the settings flow breaks with "Property username is missing".
b
A message from kapa.ai
I'm sorry, but the knowledge sources do not contain enough information to explain why setting the username field to disabled in the UI causes the Ory settings flow to break with "Property username is missing." There is no explicit documentation or troubleshooting guidance in the provided sources regarding this specific behavior or how Ory Elements or Ory Identities handle disabled fields in the settings flow submission. If you need a definitive answer or workaround, I recommend consulting the official Ory documentation or reaching out to the Ory community for further support.