Hi Dirk,
currently it is so, if you define an ACE, the principal has to consist of
the userpath + user. If you do a propfind acl, the principals of the ACEs
also consist of the contextpath + userpath + user. This seems for me slide
specific and not webdav conform. So I would like to change the
parsePrincipal() method of the ACLMethod as follow (see bold typed):
protected String parsePrincipal(Element principal) throws
WebdavException {
// FIXME: make constants and make sure they are used in
// AclMethod:parsePrincipal and PropFindMethod:writePrincipal
NodeList hrefList =
principal.getElementsByTagNameNS(NodeProperty.DEFAULT_NAMESPACE, "href");
if (hrefList.getLength() == 1) {
Element href = (Element) hrefList.item(0);
if (href.getFirstChild().getNodeType() ==
Node.TEXT_NODE){
if
(token.getNamespaceConfig().getUsersPath() != null) {
return
(token.getNamespaceConfig().getUsersPath() + "/" +
getSlidePath(href.getFirstChild().getNodeValue()));
} else {
return
getSlidePath(href.getFirstChild().getNodeValue());
}
}
} else if (hasChild(principal, NodeProperty.DEFAULT_NAMESPACE,
"all")) {
return "nobody";
} else if (hasChild(principal, NodeProperty.DEFAULT_NAMESPACE,
"self")) {
return "~";
} else if (hasChild(principal, NodeProperty.DEFAULT_NAMESPACE,
"unauthenticated")) {
return token.getNamespaceConfig().getUsersPath() + "/" +
token.getNamespaceConfig().getGuestPath();
}
throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
}
and the writePrincipal() method of the PropFind Method:
protected void writePrincipal(XMLPrinter generatedXML, String principal)
{
generatedXML.writeElement(null, PRINCIPAL, XMLPrinter.OPENING);
// FIXME: Apparently, there are or will be some other cases, but it
// isn't very clear in the spec
// remove userpath, if available
if
(principal.startsWith(token.getNamespaceConfig().getUsersPath())){
if (principal.length() ==
(token.getNamespaceConfig().
getUsersPath()).length()) {
principal = "nobody";
} else {
principal =
principal.substring((token.getNamespaceConfig().
getUsersPath() + "/").length());
}
}
if (principal.equals("~")) {
generatedXML.writeElement(null, "self", XMLPrinter.NO_CONTENT);
} else if (principal.equals("nobody")) {
generatedXML.writeElement(null, "all",
XMLPrinter.NO_CONTENT);
} else {
generatedXML.writeElement(null, "href", XMLPrinter.OPENING);
generatedXML.writeText(principal);
// generatedXML.writeText(getFullPath(principal));
generatedXML.writeElement(null, "href", XMLPrinter.CLOSING);
}
generatedXML.writeElement(null, PRINCIPAL, XMLPrinter.CLOSING);
}
Now just the user without any path-prefix has to be passed with the ACL
method or will be returned by the PropFind method. What do you think about
it and do you remember of any further parts that have to be changed in this
context as well?
regards
Eckehard
Eckehard Hermann
Research & Development
Software AG
Uhlandstrasse 12
D-64297 Darmstadt
Germany
mailto:[EMAIL PROTECTED]
phone: +49-6151-921465
fax: +49-6151-921609
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>