mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-13 18:50:53 +00:00
assert sanitized and stripped paths
This commit is contained in:
parent
c08754cf92
commit
5429f5c1a9
19 changed files with 108 additions and 72 deletions
|
@ -19,11 +19,12 @@ Custom rights management.
|
|||
|
||||
"""
|
||||
|
||||
from radicale import rights
|
||||
from radicale import pathutils, rights
|
||||
|
||||
|
||||
class Rights(rights.BaseRights):
|
||||
def authorized(self, user, path, permissions):
|
||||
if path.strip("/") not in ("tmp", "other"):
|
||||
sane_path = pathutils.strip_path(path)
|
||||
if sane_path not in ("tmp", "other"):
|
||||
return ""
|
||||
return rights.intersect_permissions(permissions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue