2
0
Bifurcation 0

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

Cette révision appartient à :
Fabien BOURGEOIS 2018-05-16 09:43:14 +02:00
Parent 258ccac379
révision 274bc29313
1 fichiers modifiés avec 8 ajouts et 3 suppressions

Voir le fichier

@ -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'