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

Reply via email to