Hi, You just need to save a document with the following line and view it: $xwiki.flushCache() I use the following: -------8<------------8<------------8<------------8<----- #set($confirmed=$request.get("confirm")) #if ($confirmed=="yes") $xwiki.flushCache() 1.1 You've flushed the cache!<br> #else 1.1 Do you really want to flush the cache? Flushing the wiki's object cache is a global operation and temporarily slows down the site for all users. Please only flush the cache if really necessary. *I have read and understood the above. I really need to [flush the cache>${doc.fullName}?confirm=yes].* #end -------8<------------8<------------8<------------8<----- Regards, Robin On 14/06/06, Duke Tantiprasut <[email protected]> wrote:
How do you flush the cache?
Thanks Duke
On 6/14/06, Robinson Nathaniel <[email protected]> wrote:
Apparently this feature is "missing" in 0.9.840. I don't know what's in the source versions now.
I got around this problem by assigning privileges for the group to a page, and then checking for access to that page (less code).
Ludovic sent me the following script, which I believe is a more direct answer to your question:
Currently there is no xwiki API for groups (it's missing).. But this works:
#set($ismember = false) #set($groupdoc = $xwiki.getDocument("XWiki.MyGroup")) #set($memberobj = $groupdoc.getObjects(" XWiki.XWikiGroups")) #foreach($mobj in $memberobj) #set ($member = $groupdoc.display("member", "view", $mobj)) #if($member == $context.user) #set($ismember = true) #end #end
#if($ismember==true) do your stuff #end
Don't forget to flush the cache after changing the members in a group. It's another "bug" in 0.9.840.
Good luck!
-Nate
-----Original Message----- From: Jeff Ousley [mailto:[email protected]] Sent: Wednesday, June 14, 2006 7:12 AM To: [email protected] Subject: [xwiki-users] check for group membership
Hello,
Is there a way via velocity to check whether or not a user has membership in a particular group? Could someone provide or point me to examples of this.
Thanks! -jeff
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto: [email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws