Adding password hashing
This commit is contained in:
26
plugins/radicale_stamm_rights/__init__.py
Normal file
26
plugins/radicale_stamm_rights/__init__.py
Normal file
@ -0,0 +1,26 @@
|
||||
from radicale.rights import BaseRights
|
||||
from radicale.
|
||||
import urllib.request
|
||||
import json
|
||||
import hashlib
|
||||
|
||||
|
||||
class Rights(BaseRights):
|
||||
def __init__(self, configuration, logger):
|
||||
self.configuration = configuration
|
||||
self.logger = logger
|
||||
|
||||
def authorized(self, user, path, permission):
|
||||
"""Check if the user is allowed to read or write the collection.
|
||||
If ``user`` is empty, check for anonymous rights.
|
||||
``path`` is sanitized.
|
||||
``permission`` is "r" or "w".
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def authorized_item(self, user, path, permission):
|
||||
"""Check if the user is allowed to read or write the item."""
|
||||
path = storage.sanitize_path(path)
|
||||
parent_path = storage.sanitize_path(
|
||||
"/%s/" % posixpath.dirname(path.strip("/")))
|
||||
return self.authorized(user, parent_path, permission)
|
Reference in New Issue
Block a user