antoine seilles wrote:
I use the addObject method to create new annotation, my plugin. When a user submit the form to add an annotation, i call addObject('annotationClass') . But, to invoke this method, user might have the edit right. And i'd like to have possibility to annotate with only comment right.
How to create a method addAnnotation that need only comment right to be called?
Thank for your time.
Antoine
1. Add a new Action (com.xpn.xwiki.web.AnnotationAction). You can adapt it from Comment 2. In <webapp-root>/WEB-INF/struts-config.xml add the AnnotationAction and map it to /annotate/ 3. In com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl#getRight add: actionMap.put("annotate", "comment"); 4. Compile the modified XWikiRightServiceImpl and either replace the existing class from xwiki-core-*.jar, or put it in <webapp-root>/WEB-INF/classes/com/xpn/xwiki/user/impl/xwiki/ Or you can just rebuild the whole xwiki-core. That's a lot of changes, and I don't like it. This is why I'd like to be able to: - Hook rights from plugins, without having to change and recompile core classes - Add actions without having to change struts-config.xml -- Sergiu Dumitriu http://purl.org/net/sergiu/