Authenticate SWT event loop.
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 26 Jun 2022 08:45:12 +0000 (10:45 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 26 Jun 2022 08:45:12 +0000 (10:45 +0200)
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;