@moin this PR DEV: Add resolve_group_membership functionality to theme settings - Pull Request #41360 - discourse/discourse - GitHub is now merged and I’m adding docs in DEV: Docs for theme setting resolve_group_membership - Pull Request #41537 - discourse/discourse - GitHub . I’ve fixed discourse-copy-post with DEV: Use resolve_group_membership core theme functionality - Pull Request #37 - discourse/discourse-copy-post - GitHub and now I am going through our other official plugins to see if any others need the same treatment (e.g. you already pointed to GitHub - discourse/discourse-unanswered-filter · GitHub )
For your own Filter Favorites , you can see the copy-post example I did, but basically you need to add resolve_group_membership: true to both default_favorite_filters_groups and custom_favorite_filters_allowed_groups , then they will be available as booleans depending on the user’s group memberships on settings as settings.user_in_default_favorite_filters_groups and settings.user_in_custom_favorite_filters_allowed_groups respectively, and you now no longer need to manually check user group IDs on the frontend.
I would change the default of default_favorite_filters_groups to 4|5 in your theme component, which is logged in & anonymous users, rather than 0 (everyone) which is going away soon.
I will make a note to run a DB migration on theme settings when I get rid of the everyone group, I need to do one for site settings too, this will happen when the upcoming change moves to permanent in the next few weeks (depending on whether other issues come up and how fast I get through fixing other themes/components that need resolve_group_membership added).
No there is no way to do this at the moment like there is for site settings…I don’t think it’s necessary to add right now, you can just mention this in the setting description and guard with currentUser in the frontend anyway. Maybe in future I will add this if there is more need.