Skip to Content
Menú
This question has been flagged
1 Respondre
3571 Vistes

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
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
5
de gen. 22
11584
3
de març 15
4421
1
de maig 24
2108
0
d’ag. 23
2190
0
de juny 20
2507