mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
Simplify Rights plugin interface
This commit is contained in:
parent
8ca01a4989
commit
f6a3a19680
11 changed files with 51 additions and 43 deletions
|
@ -29,12 +29,12 @@ class Rights(rights.BaseRights):
|
|||
super().__init__(*args, **kwargs)
|
||||
self._verify_user = self.configuration.get("auth", "type") != "none"
|
||||
|
||||
def authorized(self, user, path, permissions):
|
||||
def authorization(self, user, path):
|
||||
if self._verify_user and not user:
|
||||
return ""
|
||||
sane_path = pathutils.strip_path(path)
|
||||
if "/" not in sane_path:
|
||||
return rights.intersect_permissions(permissions, "RW")
|
||||
return "RW"
|
||||
if sane_path.count("/") == 1:
|
||||
return rights.intersect_permissions(permissions, "rw")
|
||||
return "rw"
|
||||
return ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue