Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3641 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
5
ม.ค. 22
11674
3
มี.ค. 15
4473
1
พ.ค. 24
2208
0
ส.ค. 23
2252
0
มิ.ย. 20
2536