Fix privilege set for read only collection
This commit is contained in:
parent
3a4184d1ab
commit
aa04aa04b7
@ -45,7 +45,7 @@ except ImportError:
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from . import client, config, ical
|
from . import client, config, ical, rights
|
||||||
|
|
||||||
|
|
||||||
NAMESPACES = {
|
NAMESPACES = {
|
||||||
@ -300,8 +300,10 @@ def _propfind_response(path, item, props, user):
|
|||||||
element.append(tag)
|
element.append(tag)
|
||||||
elif tag == _tag("D", "current-user-privilege-set"):
|
elif tag == _tag("D", "current-user-privilege-set"):
|
||||||
privilege = ET.Element(_tag("D", "privilege"))
|
privilege = ET.Element(_tag("D", "privilege"))
|
||||||
|
if rights.authorized(user, item, "w"):
|
||||||
privilege.append(ET.Element(_tag("D", "all")))
|
privilege.append(ET.Element(_tag("D", "all")))
|
||||||
privilege.append(ET.Element(_tag("D", "read")))
|
privilege.append(ET.Element(_tag("D", "read")))
|
||||||
|
if rights.authorized(user, item, "w"):
|
||||||
privilege.append(ET.Element(_tag("D", "write")))
|
privilege.append(ET.Element(_tag("D", "write")))
|
||||||
privilege.append(ET.Element(_tag("D", "write-properties")))
|
privilege.append(ET.Element(_tag("D", "write-properties")))
|
||||||
privilege.append(ET.Element(_tag("D", "write-content")))
|
privilege.append(ET.Element(_tag("D", "write-content")))
|
||||||
|
Loading…
Reference in New Issue
Block a user