TomJaud
February 24, 2024, 9:28am
1
I'm trying to hide component within an app which is public viewable with this code:
{{!current_user.groups.some(group => group.id === 2478655)
}}
Javascript code seems to work, but the component is actually viewable when accessing it with an icognito tab.
Any idea?
TomJaud
February 24, 2024, 9:52am
2
it seems that in public view the current_user object ist not available
Any idea how I can hide/disable componets inside a public view?
TomJaud
February 24, 2024, 9:58am
3
Solved!
As the current_user object seems to not be available in public.
Instead of trying to hide componets, I have set the "show body" option inside the appearance section for containers to achieve visability only for users.
OR LIKE THIS:
You can also use
!current_user || !current_user.groups || !current_user.groups.some(group => group.id === 2478655)
within the "hidden" field
2 Likes