[xwiki-users] Problem with Access Level
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 ? -- View this message in context: http://n2.nabble.com/Problem-with-Access-Level-tp3383383p3383383.html Sent from the XWiki- Users mailing list archive at Nabble.com.
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/
Thank you for your answer. The logs show me several thousands of lines and I don't understand where I can find the information. There, an example of the lines I get : 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,Conception.WebPreferences,view,false,true,true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 7 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: view in view,comment 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found matching right in XWiki.XWikiAllGroup for XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Access has been granted for (xwiki:XWiki.gco,Conception.Outils,view): web level 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - hasAccessLevel for view, xwiki:XWiki.gco, Conception.Outils 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.gco,XWiki.XWikiPreferences,admin,true,true,true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 3 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in admin,edit,undelete, 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Failed match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 1 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,edit,comment,register,undelete, 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 2 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,register, 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,XWiki.XWikiPreferences,admin,false,true,true Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception. -- Gwen 2009/8/4 Sergiu Dumitriu <[email protected]>
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/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Gwenhaël, On Tue, Aug 4, 2009 at 4:25 PM, Gwenhaël CORAY <[email protected]> wrote:
Thank you for your answer.
The logs show me several thousands of lines and I don't understand where I can find the information.
There, an example of the lines I get :
2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,Conception.WebPreferences,view,false,true,true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 7 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: view in view,comment 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true
2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found matching right in XWiki.XWikiAllGroup for XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Access has been granted for (xwiki:XWiki.gco,Conception.Outils,view): web level 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - hasAccessLevel for view, xwiki:XWiki.gco, Conception.Outils 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.gco,XWiki.XWikiPreferences,admin,true,true,true 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 3 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in admin,edit,undelete, 2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true
2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Failed match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 1 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,edit,comment,register,undelete, 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 2 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,register, 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,777 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,XWiki.XWikiPreferences,admin,false,true,true
Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception.
-- Gwen
2009/8/4 Sergiu Dumitriu <[email protected]>
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.
Just a quick check: The "Main.Dashboard" page is located in the "Main" space (the "." is the delimiter between spaces and pages in XWiki) so you'll never see it in the list of documents in the "Conception" space. Guillaume
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/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
I know, but I included this page in my Conception.WebHome : #includeInContext("Main.Dashboard") The Dashboard allows me to see the recent changes for the current space, the tags in the current space and, normally, the documents in the current space. By the way, I can see the Conception documents when logged as admin. -- Gwen 2009/8/4 Guillaume Lerouge <[email protected]>
Hi Gwenhaël,
On Tue, Aug 4, 2009 at 4:25 PM, Gwenhaël CORAY <[email protected]> wrote:
Thank you for your answer.
The logs show me several thousands of lines and I don't understand where I can find the information.
There, an example of the lines I get :
2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,Conception.WebPreferences,view,false,true,true 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 7 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: view in view,comment 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true
2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.XWikiAllGroup in XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found matching right in XWiki.XWikiAllGroup for XWiki.XWikiAllGroup 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Access has been granted for (xwiki:XWiki.gco,Conception.Outils,view): web level 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - hasAccessLevel for view, xwiki:XWiki.gco, Conception.Outils 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.gco,XWiki.XWikiPreferences,admin,true,true,true 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking objects 3 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 0 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in admin,edit,undelete, 2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Found a right for true
2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Failed match: xwiki:XWiki.gco in 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 1 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,edit,comment,register,undelete, 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking object 2 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking match: admin in view,register, 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights for 2 groups: [xwiki:XWiki.XWikiAllGroup, xwiki:XWiki.Conception] 2009-08-04 15:00:41,777 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Checking right: xwiki:XWiki.XWikiAllGroup,XWiki.XWikiPreferences,admin,false,true,true
Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception.
-- Gwen
2009/8/4 Sergiu Dumitriu <[email protected]>
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.
Just a quick check: The "Main.Dashboard" page is located in the "Main" space (the "." is the delimiter between spaces and pages in XWiki) so you'll never see it in the list of documents in the "Conception" space.
Guillaume
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/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Gwenhaël CORAY wrote:
Thank you for your answer.
The logs show me several thousands of lines and I don't understand where I can find the information.
There, an example of the lines I get :
2009-08-04 15:00:41,776 [http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level
Could you save the log in a file and upload it somewhere, then give me a link to it?
Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
I save the file on this board : http://www.humyo.fr/F/9681993-983991337 -- Gwen 2009/8/4 Sergiu Dumitriu <[email protected]>
Gwenhaël CORAY wrote:
Thank you for your answer.
The logs show me several thousands of lines and I don't understand where I can find the information.
There, an example of the lines I get :
2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level
Could you save the log in a file and upload it somewhere, then give me a link to it?
Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception.
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Some tests I made and let me perplexed : I can't view the list of documents in the current space although everybody has "view" rights on all spaces. I view the docs only if I have the "admin" right on the space. #set($docNames = $xwiki.getSpaceDocsName($doc.space)) #foreach($doc in $docNames) $doc returns the name of the page without the name of the space. Exemple : for the page "Conception.Outils" ("Conception" is the space, "Outils" the page), $doc returns "Outils" By specifying the space : #if($xwiki.hasAccessLevel("view", $context.user, "Conception.Outils")) an user with only "view" right see the list of docs. In summary : #if($xwiki.hasAccessLevel("view", $context.user, "Outils")) returns false for users with "view" right (true with "admin" right) and #if($xwiki.hasAccessLevel("view", $context.user, "Conception.Outils")) returns true for users with "view" right. gwenhaelc wrote:
I save the file on this board : http://www.humyo.fr/F/9681993-983991337
-- Gwen
2009/8/4 Sergiu Dumitriu <[email protected]>
Gwenhaël CORAY wrote:
Thank you for your answer.
The logs show me several thousands of lines and I don't understand where I can find the information.
There, an example of the lines I get :
2009-08-04 15:00:41,776 [ http://localhost:8080/xwiki/bin/view/Conception/] [http-8080-1] DEBUG xwiki.XWikiRightServiceImpl - Searching for matching rights at group level
Could you save the log in a file and upload it somewhere, then give me a link to it?
Conception is the space wich I want to see the documents. gco is a user who is in two groups : XWikiAllGroup and Conception. XWikiAllGroup has view and comment rights on all documents and Conception group has view, comment, edit and delete rights on documents of the space Conception.
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://n2.nabble.com/Problem-with-Access-Level-tp3383383p3397409.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (4)
-
Guillaume Lerouge -
gwenhaelc -
Gwenhaël CORAY -
Sergiu Dumitriu