Monotone-Parent: d8678bc76a58d190f4f7fc03f138123104dfb577
Monotone-Revision: e44f8ed7f2cb0a7509257497630e18c476b9b901 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-20T13:42:16 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
b2f882a898
commit
d9cf3145da
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2010-09-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* Tests/Integration/test-davacl.py
|
||||||
|
(DAVCalendarPublicAclTest.testCollectionAccessNormalUser): make
|
||||||
|
use of the fix below when removing the rights for the subscriber
|
||||||
|
user.
|
||||||
|
|
||||||
|
* Tests/Integration/utilities.py (TestACLUtility.setupRights):
|
||||||
|
when "rights" is None or unspecified, the user is now deleted from
|
||||||
|
the access list. This enable default roles to take place for the
|
||||||
|
specified user, which is different from simply removing all its
|
||||||
|
rights.
|
||||||
|
|
||||||
2010-09-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-09-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* Main/SOGo+DAV.m (-davComplianceClassesInContext:): new method to
|
* Main/SOGo+DAV.m (-davComplianceClassesInContext:): new method to
|
||||||
|
|
|
@ -1014,7 +1014,7 @@ class DAVCalendarPublicAclTest(unittest.TestCase):
|
||||||
"href was returned more than once: %s" % href.text)
|
"href was returned more than once: %s" % href.text)
|
||||||
resourceHrefs[href.text] = True
|
resourceHrefs[href.text] = True
|
||||||
|
|
||||||
acl_utility.setupRights(subscriber_username, {})
|
acl_utility.setupRights(subscriber_username)
|
||||||
|
|
||||||
# 3. creation right added for "default user"
|
# 3. creation right added for "default user"
|
||||||
# subscriber_username expected to have access, but not "anonymous"
|
# subscriber_username expected to have access, but not "anonymous"
|
||||||
|
|
|
@ -64,22 +64,34 @@ class TestACLUtility(TestUtility):
|
||||||
def rightsToSOGoRights(self, rights):
|
def rightsToSOGoRights(self, rights):
|
||||||
self.fail("subclass must implement this method")
|
self.fail("subclass must implement this method")
|
||||||
|
|
||||||
def setupRights(self, username, rights):
|
def setupRights(self, username, rights = None):
|
||||||
rights_str = "".join(["<%s/>"
|
if rights is not None:
|
||||||
% x for x in self.rightsToSOGoRights(rights) ])
|
rights_str = "".join(["<%s/>"
|
||||||
aclQuery = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
% x for x in self.rightsToSOGoRights(rights) ])
|
||||||
+ "<acl-query"
|
aclQuery = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
+ " xmlns=\"urn:inverse:params:xml:ns:inverse-dav\">"
|
+ "<acl-query"
|
||||||
+ "<set-roles user=\"%s\">%s</set-roles>" % (xml.sax.saxutils.escape(username),
|
+ " xmlns=\"urn:inverse:params:xml:ns:inverse-dav\">"
|
||||||
rights_str)
|
+ "<set-roles user=\"%s\">%s</set-roles>" % (xml.sax.saxutils.escape(username),
|
||||||
+ "</acl-query>")
|
rights_str)
|
||||||
|
+ "</acl-query>")
|
||||||
|
else:
|
||||||
|
aclQuery = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
|
+ "<acl-query"
|
||||||
|
+ " xmlns=\"urn:inverse:params:xml:ns:inverse-dav\">"
|
||||||
|
+ "<remove-user user=\"%s\"/>" % xml.sax.saxutils.escape(username)
|
||||||
|
+ "</acl-query>")
|
||||||
|
|
||||||
post = webdavlib.HTTPPOST(self.resource, aclQuery)
|
post = webdavlib.HTTPPOST(self.resource, aclQuery)
|
||||||
post.content_type = "application/xml; charset=\"utf-8\""
|
post.content_type = "application/xml; charset=\"utf-8\""
|
||||||
self.client.execute(post)
|
self.client.execute(post)
|
||||||
self.test.assertEquals(post.response["status"], 204,
|
|
||||||
"rights modification: failure to set '%s' (status: %d)"
|
if rights is None:
|
||||||
% (rights_str, post.response["status"]))
|
err_msg = ("rights modification: failure to remove entry (status: %d)"
|
||||||
|
% post.response["status"])
|
||||||
|
else:
|
||||||
|
err_msg = ("rights modification: failure to set '%s' (status: %d)"
|
||||||
|
% (rights_str, post.response["status"]))
|
||||||
|
self.test.assertEquals(post.response["status"], 204, err_msg)
|
||||||
|
|
||||||
# Calendar:
|
# Calendar:
|
||||||
# rights:
|
# rights:
|
||||||
|
|
Loading…
Reference in New Issue