Hi,
I am trying to implement a pagination feature on one of the space which
list only document that is accessible by the current user. The access
rights on each document is different. How do i go about in resolving this
issue?
Thanks
________________________________
From: Sergiu Dumitriu <sergiu(a)xwiki.com>
To: XWiki Developers <devs(a)xwiki.org>
Sent: Wednesday, 22 April 2009 12:19:33
Subject: Re: [xwiki-devs] HQL help needed
Colin Tay wrote:
Hi,
I would like to retrieve the number of document that is viewable by the current user
(Meaning it has the access to the document).
How can i modified the following codes to achieve that feature?
#set($query="select count(doc) from XWikiDocument doc")
#set($resultsCount = $xwiki.search($query).get(0))
Access rights have a complex logic that can't be easily expressed in
HQL. Your only choice is to iterate over all documents and check the
access rights for each one, but this is really hard on performance. What
is your goal?
A better variant is to first get the list of spaces, since spaces are a
little less numerous, and check the access rights on the space's main
page, and sum the number of pages in each accessible space. This assumes
that inside a space the user has the same rights for each document, so
it might not apply to your case.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs