@Test public void noChange() throws XWikiException { XWikiDocument document = new XWikiDocument(new DocumentReference("wiki", "space", "page")); document.newXObject(XWikiRightsDocumentInitializer.CLASS_REFERENCE, oldcore.getXWikiContext()); document.setOriginalDocument(document.clone()); XWikiDocument before = document.clone(); this.listener.onEvent(new UserUpdatingDocumentEvent(), document, null); assertEquals(before, document); }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; UserEvent userEvent = (UserEvent) event; checkModifiedRights(userEvent.getUserReference(), document, XWikiRightsDocumentInitializer.CLASS_REFERENCE, null); checkModifiedRights(userEvent.getUserReference(), document, XWikiGlobalRightsDocumentInitializer.CLASS_REFERENCE, (CancelableEvent) event); }
RightsFilterListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; UserEvent userEvent = (UserEvent) event; checkModifiedRights(userEvent.getUserReference(), document, XWikiRightsDocumentInitializer.CLASS_REFERENCE, null); checkModifiedRights(userEvent.getUserReference(), document, XWikiGlobalRightsDocumentInitializer.CLASS_REFERENCE, (CancelableEvent) event); } }
RightsFilterListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; UserEvent userEvent = (UserEvent) event; checkModifiedRights(userEvent.getUserReference(), document, XWikiRightsDocumentInitializer.CLASS_REFERENCE, null); checkModifiedRights(userEvent.getUserReference(), document, XWikiGlobalRightsDocumentInitializer.CLASS_REFERENCE, (CancelableEvent) event); } RightsFilterListener(); }
RightsFilterListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; UserEvent userEvent = (UserEvent) event; checkModifiedRights(userEvent.getUserReference(), document, XWikiRightsDocumentInitializer.CLASS_REFERENCE, null); checkModifiedRights(userEvent.getUserReference(), document, XWikiGlobalRightsDocumentInitializer.CLASS_REFERENCE, (CancelableEvent) event); } RightsFilterListener(); @Override void onEvent(Event event, Object source, Object data); }
RightsFilterListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; UserEvent userEvent = (UserEvent) event; checkModifiedRights(userEvent.getUserReference(), document, XWikiRightsDocumentInitializer.CLASS_REFERENCE, null); checkModifiedRights(userEvent.getUserReference(), document, XWikiGlobalRightsDocumentInitializer.CLASS_REFERENCE, (CancelableEvent) event); } RightsFilterListener(); @Override void onEvent(Event event, Object source, Object data); static final String NAME; }