Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3770 Zobrazení

for example.some snippet content in website should only visible for portal user only after login.other content should be public,and other should be only for admin user

Avatar
Zrušit
Nejlepší odpověď

Hi,

You could check the group of the user logged in in the snippet block. 

Eg:

<t t-snippet=“module_name.snippet_template_name”


    t-if=“request.env.user.has_group(‘base.group_portal’)” t-thumbnail=“thumbnail image link”/>


The above snippet block will only be available for portal user.

<t t-snippet=“module_name.snippet_template_name”


    t-if=“request.env.user.has_group(‘base.user_admin’)” t-thumbnail=“thumbnail image link”/>


The above snippet block will be available for admin user

Regards

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
5
led 22
11827
3
bře 15
4575
1
kvě 24
2511
0
srp 23
2453
0
čvn 20
2643