[FIX]Radicale Odoo Right : we must take care of authenticated users alongside paths

这个提交包含在:
Fabien BOURGEOIS 2018-05-16 09:43:14 +02:00
父节点 258ccac379
当前提交 274bc29313
共有 1 个文件被更改,包括 8 次插入3 次删除

查看文件

@ -25,7 +25,12 @@ class Rights(BaseRights):
""" BaseRights implementation for Odoo Radicale """
def authorized(self, user, path, permission):
return permission == 'r'
def authorized_item(self, user, path, permission):
""" Authorized only readonly for authenticated users on their path """
if not user:
return False
if path == '/':
return True
path = path.strip('/').split('/')
if user != path[0]:
return False
return permission == 'r'