Tiago Rinck Caveden wrote: > Hello! > > In my wiki, I've saved a page that can be visualized by everybody, included > non logged users. The edition is restricted to logged users, though. > However, in this page I added a little script that changes some object > values when the page is viewed and then saves it. If somebody not logged try > to simply view the page, he receives an exception saying he doesn't have > rights for it. > > IMHO, the script execution should be done with the rights of the person that > saved it.. In this case, I would like everybody that can view the page to be > able to execute the script and save the page in the terms I've decided in > the script.
Use $doc.saveWithProgrammingRights instead of $doc.save(). Note that this requires the editor to save programming rights. If you don't fully trust your editors, don't give them programming rights, as they are quite dangerous. > Despite which is the best approach, is there any workaround for my case that > does not include allowing anonymous edition of the page? > > Thank you very much, -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list email@example.com http://lists.xwiki.org/mailman/listinfo/users