Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3633 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
5
Jan 22
11664
3
Mar 15
4470
1
Mei 24
2198
0
Agu 23
2242
0
Jun 20
2533