Re: [xwiki-users] rights of current user
Ok, maybe checking permission to WebHome isn't the best way to go, so if anyone could follow up on the sql query suggestion, it would be nice. However, I still don't understand why my script doesn't work. If a user has viewing rights on a WebHome page (the user can actually view the page), the hasAccessLevel method still returns false. Why is this?? I've tried replacing 'WebHome' with 'WebPreferences', but with the same result. Bjørnar Jan Kodera wrote: Hi, i think the problem is, that space preferences is in ${space}.WebPreferences page and not in WebHome. Your script just find, if the user have rights to WebHome page not for entire space. WebPreferences has object global rights and i think there you have to do some sql query to find out, if user have rights or not. Jan On 12/17/07, *Bjørnar Libæk* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I would like to have a script that finds out for which spaces the current user has view rights. I try to do: #set($spaces = $xwiki.spaces) #foreach($space in $spaces) #set($whome = $xwiki.getDocument(${space}.WebHome)) [$space${space}.WebHome] #if($whome.hasAccessLevel(view,$xwiki.getUser())) acess? Yupbr #else access? Nopebr #end #end but hasAccessLevel always return false. What am I missing? Is there any other way to do this? ___ users mailing list users@xwiki.org mailto:users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] rights of current user
I try to use groups to determine my rights wherever possible, so for me I just do a check on the user's group membership. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bjørnar Libæk Sent: 18 December 2007 09:32 To: XWiki Users Subject: Re: [xwiki-users] rights of current user Ok, maybe checking permission to WebHome isn't the best way to go, so if anyone could follow up on the sql query suggestion, it would be nice. However, I still don't understand why my script doesn't work. If a user has viewing rights on a WebHome page (the user can actually view the page), the hasAccessLevel method still returns false. Why is this?? I've tried replacing 'WebHome' with 'WebPreferences', but with the same result. Bjørnar Jan Kodera wrote: Hi, i think the problem is, that space preferences is in ${space}.WebPreferences page and not in WebHome. Your script just find, if the user have rights to WebHome page not for entire space. WebPreferences has object global rights and i think there you have to do some sql query to find out, if user have rights or not. Jan On 12/17/07, *Bjørnar Libæk* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I would like to have a script that finds out for which spaces the current user has view rights. I try to do: #set($spaces = $xwiki.spaces) #foreach($space in $spaces) #set($whome = $xwiki.getDocument(${space}.WebHome)) [$space${space}.WebHome] #if($whome.hasAccessLevel(view,$xwiki.getUser())) acess? Yupbr #else access? Nopebr #end #end but hasAccessLevel always return false. What am I missing? Is there any other way to do this? ___ users mailing list users@xwiki.org mailto:users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- -- ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] rights of current user
Sergiu Dumitriu wrote: #if($whome.hasAccessLevel(view,$context.getUser())) Ok, I tried this, but now the method returns true every time... Even when explicitly adding an access rule denying view access for a specific user, the method returns true. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Can't set permissions
Permission setting results in the following (this example is for a particular space): Error number 4001 in 4: Error while parsing velocity page Wrapped Exception: Invocation of method 'getSpaces' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc.web from XWikiDocument doc Wrapped Exception: could not execute query @ [62,34] Error number 4001 in 4: Error while parsing velocity page Wrapped Exception: Invocation of method 'getSpaces' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc.web from XWikiDocument doc Wrapped Exception: could not execute query @ unknown template[62,34] com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing velocity page Wrapped Exception: Invocation of method 'getSpaces' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc.web from XWikiDocument doc Wrapped Exception: could not execute query @ unknown template[62,34] at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRendere r.java:157) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1353) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1314) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:605) at sun.reflect.GeneratedMethodAccessor214.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invok e(UberspectImpl.java:295) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java :245) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReferenc e.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference .java:294) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.jav a:318) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(Velocimacr oProxy.java:194) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective .java:170) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74 ) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.jav a:318) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfState ment.java:107) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.jav a:318) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRendere r.java:238) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRendere r.java:152) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1353) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1314) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:105) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:158) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodi ngFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2 63) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process( Http11Protocol.java:584)
Re: [xwiki-users] Event Calendar modification
André Pestana wrote: Hello! How could I change the calendar of EventCalendar? I couldn't find a way of change it. What's this calendar? a macro? Thanks in advance! -- André Pestana It is generated by a java class, look in xwiki-core/src/main/java/com/xpn/xwiki/plugins/calendar/CalendarPlugin.java Sergiu ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Permission Rights and Parent pages
Hi everybody, I'm trying to set some rights on some pages, and i'd like to have those permissions setted automatically on some other pages. I've setted on one and i've set for the other the first one as the parent. This isn't working :( How can i solve it?? Thank you! ___ L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] CAPTCHA for comments and registration
Antonio, Were you able to get this working? On Dec 18, 2007 4:17 PM, marlon hendred [EMAIL PROTECTED] wrote: Is no one going to help? On Dec 3, 2007 3:16 AM, Antonio Goncalves [EMAIL PROTECTED] wrote: Hi, I'm also trying to add captcha validation to the comments. I've looked at Dodo skin and I'm trying to do the same for Albatross but it doesn't work. I've set xwiki.plugin.captcha=1 in the xwiki.cfg . Dodo uses comments.vm but it looks like the most appropriate place in Albatros is commentsinline.vm, am I right ? Then, when I copy the following code into commentsinline.vm but nothing happens #if ($captchaPlugin) $captchaPlugin.displayCaptcha(comment,wiki_captcha) #end Any idea 2007/11/29, marlon hendred [EMAIL PROTECTED]: Hello All, Im trying to captcha validate my register page on my xwiki because i've had a problem with spam bots. I am using the albatross skin on xwiki v1.1.1.5166. I've asked this question before, and was told by someone to look at captcha.vm, edit.vm etc... in the dodo skins. The only thing I found related to captcha was this: #if ($captchaPlugin) $captchaPlugin.displayCaptcha(edit,wiki_captcha) #end I added that to the registerinline.vm file and got nothing! In WEB-INF/xwiki.cfg, the captcha plugin is set to 1. I would really appreciated it if a developer would surface and tell me how this works, what im doing wrong, or point me to some WORKING examples. Thanks. -Marlon On Nov 7, 2007 10:12 AM, marlon hendred [EMAIL PROTECTED] wrote: Hi, So what documentation or resources did you read to get this working for you? On Nov 7, 2007 1:18 AM, Guillaume Lerouge [EMAIL PROTECTED] wrote: Hi, I'm sorry but my competencies do not go so far as to explain why this does not work... It worked for me :( Guillaume On 07/11/2007, marlon hendred [EMAIL PROTECTED] wrote: Yes I have scowerd xwiki.org in search of some documentation on a lot of things but have come up empty handed every time. Although the code you gave does display the captcha with an input box, it seems that it accepts anything. How do i verify the user has input the correct value? On Nov 6, 2007 11:39 PM, Guillaume Lerouge [EMAIL PROTECTED] wrote: CaptchaName is indeed simply an arbitrary identifier you assign to your captcha, like an ID tag. That's useful when you are using the captcha twice on the same page or on your wiki. I think you can get jcaptcha to display a please tell me how much do 3+8 instead of an image, not sure how to achieve this though. As for a documentation, I guess you already checked XWiki.org+ the mailing list archives? Guillaume On 07/11/2007, marlon hendred [EMAIL PROTECTED] wrote: Thanks for the response. So I got the captcha to show up but I still have some questions. what is CaptchaName? Just an arbitrary string? and what args does displayCaptcha() take? What other methods does jcaptcha have? Is there some sort of documentation somewhere that I could look at on this? Thanks On 11/6/07, Guillaume Lerouge [EMAIL PROTECTED] wrote: You can use this (with the plugin enabled): #if ($xwiki.jcaptcha.verifyCaptcha(CaptchaName)) The code for the action that needs to be captcha protected goes here (like for sending a form for instance) form ... ##$xwiki.jcaptcha.displayCaptcha(CaptchaName, ) br / #if ($context.user== XWiki.XWikiGuest) img style=border: solid 1px #00 src=$doc.getURL(jcaptcha) br / Please type the captcha below:* br / input size=40 type=text name=jcaptcha_response / br / #end input type=hidden name=demande value=1 / input type=submit value=Send /form #end Hope this helps Guillaume On 06/11/2007, Paul Armstrong [EMAIL PROTECTED] wrote: On Mon, Nov 05, 2007 at 03:52:16PM -0800, marlon hendred wrote: Hi, can someone help me with setting up CAPTCHA with the albatross skin for registration and comments? Is there some example code I could look at? Or if someone has this working could they give some guidence? I have the captcha plugin enabled but I'm kinda stuck on what to do next. Thanks in advance. Look in the dodo skin files. Particularly: