>From http://platform.xwiki.org/xwiki/bin/view/DevGuide/API see http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/platform/xwiki-platform-oldcore/6.3/xwiki-platform-oldcore-6.3-javadoc.jar/!/com/xpn/xwiki/api/Document.html . You have saveAsAuthor() and saveWithProgrammingRights().
Hope this helps, Marius On Fri, Dec 5, 2014 at 3:12 PM, Adrien Moi <[email protected]> wrote: > Hello ! > > on one wiki page I have a skript to delete a comment on another page. But > when a user that has no edit right tries to do it, it fails. Is there a way > to go around this and let the user delete the comment as if he had edit > rights? > > > for reference here is my simplified code > > {{groovy}} > yourDocReference = new > org.xwiki.model.reference.DocumentReference('xwiki','Main','WebHome'); > yourDoc = xwiki.getDocument(yourDocReference); > comment = yourDoc.getComments(); > if(comment.isEmpty()){ > println("No Comment to remove!");} > else{ > yourDoc.removeObject(comment[comment.size()-1]); > yourDoc.save(); > println("First comment removed !")} > {{/groovy}} > > thanks for the help > > Adrien > > > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
