Hello fellas here is my question:
Is possible to restrict access to given http route by res.groups.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
2
回覆
4684
瀏覽次數
Hi,
Inside the route you can check whether user belongs to some group or not. Based on this checking you can perform your operations,
See a sample,
@http.route(['/test/page'], type='http', csrf=False, auth="user", website=True)
def redirect_test_page(self, **kwargs):
user_rec = request.env['res.users'].sudo().search([('id', '=', request.session.uid)])
if user_rec.has_group('group_external_id'):
# write the code if user belongs to group
return request.render('template_id')
else:
# code here if user not in group
return request.render('template_id')
Hope this will give you some idea.
Thanks
Thank you this is what i needed! :)
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
2
9月 21
|
3397 | ||
|
0
11月 23
|
1014 | ||
|
1
2月 21
|
4377 | ||
|
4
7月 20
|
13385 | ||
|
0
3月 18
|
3684 |