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

In the Website module, I need to display links only if the user does not belong to the helpdesk administrator group. How can I achieve this?


Example:







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

Hi 

To display links only if the user does not belong to the helpdesk administrator group in the Website module, you can use the following code:


```


<t t-if="not request.env.user.has_group('helpdesk.helpdesk_admin_group')">


    <!-- Your link code here -->


</t>


```


This code uses a template condition (`<t t-if>`) to check if the current user does not have the helpdesk administrator group (`'helpdesk.helpdesk_admin_group'`). If the user does not belong to the group, the links inside the `<t>` block will be displayed.


Please note that you need to replace `'helpdesk.helpdesk_admin_group'` with the actual technical name of your helpdesk administrator group.

Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 23
3514
3
thg 8 25
2545
1
thg 5 25
2602
1
thg 4 25
3576
1
thg 4 25
4431