gwenhaelc wrote:
Hello,
I have a problem with the hasAccessLevel() method.
I want to list all the documents existing in a space, including the page Main.Dashboard. As nothing appear in the "Documents in space", I try to list the documents with this code :
#set($docNames = $xwiki.getSpaceDocsName($doc.space))
<ul> #foreach($doc in $docNames) #if($xwiki.hasAccessLevel("view", $context.user, $doc)) <li>$doc</li> #end #end </ul>
Regarding to his group rights, the user has the "view" right on the space, as this right is checked in rights management. By the way, he can access the document.
But, documents are not listed. $xwiki.hasAccessLevel("view", $context.user, $doc) returns false.
Only admins in the XWikiAdminGroup can view the list.
Have you some ideas ?
Can you enable debug logging for the authorization part? Extract log4j.properties from WEB-INF/lib/xwiki-core-M.N.jar into WEB-INF/classes/ and append to it: log4j.logger.com.xpn.xwiki.user=debug Then restart the container, and calls to hasAccessLevel should report in the log why was the right denied. -- Sergiu Dumitriu http://purl.org/net/sergiu/