Browse Source

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

master
Fabien BOURGEOIS 1 year ago
parent
commit
274bc29313
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      radicale_odoo_right/__init__.py

+ 8
- 3
radicale_odoo_right/__init__.py View File

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

Loading…
Cancel
Save