Authenticate SWT event loop.
[lgpl/argeo-commons.git] / rap / org.argeo.cms.ui.rap / src / org / argeo / cms / web / CmsWebEntryPoint.java
index 9e407366d2eaa6f7f98908246b56c28a865bc1a3..1597197207377c27342229c13f4c01ee8a852119 100644 (file)
@@ -313,9 +313,15 @@ public class CmsWebEntryPoint implements EntryPoint, CmsView, BrowserNavigationL
                if (getApplicationContext().getLifeCycleFactory().getLifeCycle() instanceof RWTLifeCycle) {
                        eventLoop: while (!shell.isDisposed()) {
                                try {
-                                       if (!display.readAndDispatch()) {
-                                               display.sleep();
-                                       }
+                                       Subject.doAs(loginContext.getSubject(), new PrivilegedAction<Void>() {
+                                               @Override
+                                               public Void run() {
+                                                       if (!display.readAndDispatch()) {
+                                                               display.sleep();
+                                                       }
+                                                       return null;
+                                               }
+                                       });
                                } catch (Throwable e) {
                                        if (e instanceof SWTError) {
                                                SWTError swtError = (SWTError) e;