Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3654 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 1 22
11679
3
thg 3 15
4476
1
thg 5 24
2220
0
thg 8 23
2264
0
thg 6 20
2547