Hide user custom fields from users below certain trust level

AI-generated summary

In a discussion titled ‘Hide user custom fields from users below certain trust level,’ thorbenegberts asks if Discourse can restrict visibility of specific user custom fields to users above a certain trust level — particularly useful for hiding internal customer data from public view while allowing company staff to see it. They note that existing ‘staff’ preferences don’t work as expected and reference a prior thread clarifying that ‘public user custom fields’ serve a different purpose. sam responds that such functionality would currently need to be implemented via a plugin, expressing hesitation about adding more site settings due to complexity. tophee agrees the feature would be valuable and proposes a more flexible, group-based approach: allowing admins to specify which user groups can view each custom field directly when creating the field, rather than managing visibility through global site settings. This would simplify configuration and better suit use cases requiring fine-grained access control. The discussion highlights a gap in core Discourse functionality and suggests plugin development as the most viable near-term solution.

Is there a way to configure discourse to show some user custom fields only to users with a certain trust level?

This is my use case:

We use our discourse instance for communicating with our customers. We store some informations (e.g. the customer’s ID) in custom user fields via API. Some of them we want to be displayed on the public user profile for everyone, others should only be visible only to people of our company.

I tried this preferences for “staff” (even if it’s not trust level specific), but they seem to do nothing?

(I read here that “public user custom fields” is meant for another purpose. I’m okay with that, because they are already configured at the custom field settings.)

Is there a way to hide some custom fields from users below a specific trust level? Or is there any way to alter the default behavior with a plug-in?

Thanks!

1 Mi Piace

This would have to be in the plugin departement for now, a bit scared of adding 4 more site settings there it gets a bit hard to explain.

1 Mi Piace

I would also find this useful. Or rather, a more generic version of it: custom user field visibility based on group membership. Is this still plugin domain?

Perhaps a simpler version would be to flip things around: instead of specifying which TL can see which fields in site settings, add a setting to the create new user field form asking which groups can see this field. Something like this:

2 Mi Piace